<?xml version='1.0' encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <link href="cpip.css" rel="stylesheet" type="text/css" />
    <title>File: /Users/paulross/dev/Python-3.6.2/Include/abstract.h</title>
  </head>
  <body>
    <h1>File: /Users/paulross/dev/Python-3.6.2/Include/abstract.h</h1>
    <p>Green shading in the line number column
means the source is part of the translation unit, red means it is conditionally excluded.
Highlighted line numbers link to the translation unit page. Highlighted macros link to
the macro page.</p>
    <pre><a name="1" /><span class="True">       1:</span> <span class="f">#</span><span class="n">ifndef</span> <a href="macros_noref.html#_UHlfQUJTVFJBQ1RPQkpFQ1RfSF8w"><span class="b">Py_ABSTRACTOBJECT_H</span></a>
<a name="2" /><span class="True">       2:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlfQUJTVFJBQ1RPQkpFQ1RfSF8w"><span class="b">Py_ABSTRACTOBJECT_H</span></a>
<a name="3" /><span class="False">       3:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">__cplusplus</span>
<a name="4" /><span class="False">       4:</span> <span class="m">extern</span> <span class="e">&quot;C&quot;</span> <span class="f">{</span>
<a name="5" /><span class="True">       5:</span> <span class="f">#</span><span class="n">endif</span>
<a name="6" /><span class="True">       6:</span> 
<a name="7" /><span class="False">       7:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">PY_SSIZE_T_CLEAN</span>
<a name="8" /><span class="False">       8:</span> <span class="f">#</span><span class="n">define</span> <span class="b">PyObject_CallFunction</span> <span class="b">_PyObject_CallFunction_SizeT</span>
<a name="9" /><span class="False">       9:</span> <span class="f">#</span><span class="n">define</span> <span class="b">PyObject_CallMethod</span> <span class="b">_PyObject_CallMethod_SizeT</span>
<a name="10" /><span class="False">      10:</span> <span class="f">#</span><span class="n">ifndef</span> <span class="b">Py_LIMITED_API</span>
<a name="11" /><span class="False">      11:</span> <span class="f">#</span><span class="n">define</span> <span class="b">_PyObject_CallMethodId</span> <span class="b">_PyObject_CallMethodId_SizeT</span>
<a name="12" /><span class="False">      12:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* !Py_LIMITED_API */</span>
<a name="13" /><span class="True">      13:</span> <span class="f">#</span><span class="n">endif</span>
<a name="14" /><span class="True">      14:</span> 
<a name="15" /><span class="True">      15:</span> <span class="k">/* Abstract Object Interface (many thanks to Jim Fulton) */</span>
<a name="16" /><span class="True">      16:</span> 
<a name="17" /><span class="True">      17:</span> <span class="k">/*</span>
<a name="18" /><span class="True">      18:</span> <span class="k">   PROPOSAL: A Generic Python Object Interface for Python C Modules</span>
<a name="19" /><span class="True">      19:</span> <span class="k"></span>
<a name="20" /><span class="True">      20:</span> <span class="k">Problem</span>
<a name="21" /><span class="True">      21:</span> <span class="k"></span>
<a name="22" /><span class="True">      22:</span> <span class="k">  Python modules written in C that must access Python objects must do</span>
<a name="23" /><span class="True">      23:</span> <span class="k">  so through routines whose interfaces are described by a set of</span>
<a name="24" /><span class="True">      24:</span> <span class="k">  include files.  Unfortunately, these routines vary according to the</span>
<a name="25" /><span class="True">      25:</span> <span class="k">  object accessed.  To use these routines, the C programmer must check</span>
<a name="26" /><span class="True">      26:</span> <span class="k">  the type of the object being used and must call a routine based on</span>
<a name="27" /><span class="True">      27:</span> <span class="k">  the object type.  For example, to access an element of a sequence,</span>
<a name="28" /><span class="True">      28:</span> <span class="k">  the programmer must determine whether the sequence is a list or a</span>
<a name="29" /><span class="True">      29:</span> <span class="k">  tuple:</span>
<a name="30" /><span class="True">      30:</span> <span class="k"></span>
<a name="31" /><span class="True">      31:</span> <span class="k">    if(is_tupleobject(o))</span>
<a name="32" /><span class="True">      32:</span> <span class="k">      e=gettupleitem(o,i)</span>
<a name="33" /><span class="True">      33:</span> <span class="k">    else if(is_listitem(o))</span>
<a name="34" /><span class="True">      34:</span> <span class="k">      e=getlistitem(o,i)</span>
<a name="35" /><span class="True">      35:</span> <span class="k"></span>
<a name="36" /><span class="True">      36:</span> <span class="k">  If the programmer wants to get an item from another type of object</span>
<a name="37" /><span class="True">      37:</span> <span class="k">  that provides sequence behavior, there is no clear way to do it</span>
<a name="38" /><span class="True">      38:</span> <span class="k">  correctly.</span>
<a name="39" /><span class="True">      39:</span> <span class="k"></span>
<a name="40" /><span class="True">      40:</span> <span class="k">  The persistent programmer may peruse object.h and find that the</span>
<a name="41" /><span class="True">      41:</span> <span class="k">  _typeobject structure provides a means of invoking up to (currently</span>
<a name="42" /><span class="True">      42:</span> <span class="k">  about) 41 special operators.  So, for example, a routine can get an</span>
<a name="43" /><span class="True">      43:</span> <span class="k">  item from any object that provides sequence behavior. However, to</span>
<a name="44" /><span class="True">      44:</span> <span class="k">  use this mechanism, the programmer must make their code dependent on</span>
<a name="45" /><span class="True">      45:</span> <span class="k">  the current Python implementation.</span>
<a name="46" /><span class="True">      46:</span> <span class="k"></span>
<a name="47" /><span class="True">      47:</span> <span class="k">  Also, certain semantics, especially memory management semantics, may</span>
<a name="48" /><span class="True">      48:</span> <span class="k">  differ by the type of object being used.  Unfortunately, these</span>
<a name="49" /><span class="True">      49:</span> <span class="k">  semantics are not clearly described in the current include files.</span>
<a name="50" /><span class="True">      50:</span> <span class="k">  An abstract interface providing more consistent semantics is needed.</span>
<a name="51" /><span class="True">      51:</span> <span class="k"></span>
<a name="52" /><span class="True">      52:</span> <span class="k">Proposal</span>
<a name="53" /><span class="True">      53:</span> <span class="k"></span>
<a name="54" /><span class="True">      54:</span> <span class="k">  I propose the creation of a standard interface (with an associated</span>
<a name="55" /><span class="True">      55:</span> <span class="k">  library of routines and/or macros) for generically obtaining the</span>
<a name="56" /><span class="True">      56:</span> <span class="k">  services of Python objects.  This proposal can be viewed as one</span>
<a name="57" /><span class="True">      57:</span> <span class="k">  components of a Python C interface consisting of several components.</span>
<a name="58" /><span class="True">      58:</span> <span class="k"></span>
<a name="59" /><span class="True">      59:</span> <span class="k">  From the viewpoint of C access to Python services, we have (as</span>
<a name="60" /><span class="True">      60:</span> <span class="k">  suggested by Guido in off-line discussions):</span>
<a name="61" /><span class="True">      61:</span> <span class="k"></span>
<a name="62" /><span class="True">      62:</span> <span class="k">  - &quot;Very high level layer&quot;: two or three functions that let you exec or</span>
<a name="63" /><span class="True">      63:</span> <span class="k">    eval arbitrary Python code given as a string in a module whose name is</span>
<a name="64" /><span class="True">      64:</span> <span class="k">    given, passing C values in and getting C values out using</span>
<a name="65" /><span class="True">      65:</span> <span class="k">    mkvalue/getargs style format strings.  This does not require the user</span>
<a name="66" /><span class="True">      66:</span> <span class="k">    to declare any variables of type &quot;PyObject *&quot;.  This should be enough</span>
<a name="67" /><span class="True">      67:</span> <span class="k">    to write a simple application that gets Python code from the user,</span>
<a name="68" /><span class="True">      68:</span> <span class="k">    execs it, and returns the output or errors.  (Error handling must also</span>
<a name="69" /><span class="True">      69:</span> <span class="k">    be part of this API.)</span>
<a name="70" /><span class="True">      70:</span> <span class="k"></span>
<a name="71" /><span class="True">      71:</span> <span class="k">  - &quot;Abstract objects layer&quot;: which is the subject of this proposal.</span>
<a name="72" /><span class="True">      72:</span> <span class="k">    It has many functions operating on objects, and lest you do many</span>
<a name="73" /><span class="True">      73:</span> <span class="k">    things from C that you can also write in Python, without going</span>
<a name="74" /><span class="True">      74:</span> <span class="k">    through the Python parser.</span>
<a name="75" /><span class="True">      75:</span> <span class="k"></span>
<a name="76" /><span class="True">      76:</span> <span class="k">  - &quot;Concrete objects layer&quot;: This is the public type-dependent</span>
<a name="77" /><span class="True">      77:</span> <span class="k">    interface provided by the standard built-in types, such as floats,</span>
<a name="78" /><span class="True">      78:</span> <span class="k">    strings, and lists.  This interface exists and is currently</span>
<a name="79" /><span class="True">      79:</span> <span class="k">    documented by the collection of include files provided with the</span>
<a name="80" /><span class="True">      80:</span> <span class="k">    Python distributions.</span>
<a name="81" /><span class="True">      81:</span> <span class="k"></span>
<a name="82" /><span class="True">      82:</span> <span class="k">  From the point of view of Python accessing services provided by C</span>
<a name="83" /><span class="True">      83:</span> <span class="k">  modules:</span>
<a name="84" /><span class="True">      84:</span> <span class="k"></span>
<a name="85" /><span class="True">      85:</span> <span class="k">  - &quot;Python module interface&quot;: this interface consist of the basic</span>
<a name="86" /><span class="True">      86:</span> <span class="k">    routines used to define modules and their members.  Most of the</span>
<a name="87" /><span class="True">      87:</span> <span class="k">    current extensions-writing guide deals with this interface.</span>
<a name="88" /><span class="True">      88:</span> <span class="k"></span>
<a name="89" /><span class="True">      89:</span> <span class="k">  - &quot;Built-in object interface&quot;: this is the interface that a new</span>
<a name="90" /><span class="True">      90:</span> <span class="k">    built-in type must provide and the mechanisms and rules that a</span>
<a name="91" /><span class="True">      91:</span> <span class="k">    developer of a new built-in type must use and follow.</span>
<a name="92" /><span class="True">      92:</span> <span class="k"></span>
<a name="93" /><span class="True">      93:</span> <span class="k">  This proposal is a &quot;first-cut&quot; that is intended to spur</span>
<a name="94" /><span class="True">      94:</span> <span class="k">  discussion. See especially the lists of notes.</span>
<a name="95" /><span class="True">      95:</span> <span class="k"></span>
<a name="96" /><span class="True">      96:</span> <span class="k">  The Python C object interface will provide four protocols: object,</span>
<a name="97" /><span class="True">      97:</span> <span class="k">  numeric, sequence, and mapping.  Each protocol consists of a</span>
<a name="98" /><span class="True">      98:</span> <span class="k">  collection of related operations.  If an operation that is not</span>
<a name="99" /><span class="True">      99:</span> <span class="k">  provided by a particular type is invoked, then a standard exception,</span>
<a name="100" /><span class="True">     100:</span> <span class="k">  NotImplementedError is raised with an operation name as an argument.</span>
<a name="101" /><span class="True">     101:</span> <span class="k">  In addition, for convenience this interface defines a set of</span>
<a name="102" /><span class="True">     102:</span> <span class="k">  constructors for building objects of built-in types.  This is needed</span>
<a name="103" /><span class="True">     103:</span> <span class="k">  so new objects can be returned from C functions that otherwise treat</span>
<a name="104" /><span class="True">     104:</span> <span class="k">  objects generically.</span>
<a name="105" /><span class="True">     105:</span> <span class="k"></span>
<a name="106" /><span class="True">     106:</span> <span class="k">Memory Management</span>
<a name="107" /><span class="True">     107:</span> <span class="k"></span>
<a name="108" /><span class="True">     108:</span> <span class="k">  For all of the functions described in this proposal, if a function</span>
<a name="109" /><span class="True">     109:</span> <span class="k">  retains a reference to a Python object passed as an argument, then the</span>
<a name="110" /><span class="True">     110:</span> <span class="k">  function will increase the reference count of the object.  It is</span>
<a name="111" /><span class="True">     111:</span> <span class="k">  unnecessary for the caller to increase the reference count of an</span>
<a name="112" /><span class="True">     112:</span> <span class="k">  argument in anticipation of the object&apos;s retention.</span>
<a name="113" /><span class="True">     113:</span> <span class="k"></span>
<a name="114" /><span class="True">     114:</span> <span class="k">  All Python objects returned from functions should be treated as new</span>
<a name="115" /><span class="True">     115:</span> <span class="k">  objects.  Functions that return objects assume that the caller will</span>
<a name="116" /><span class="True">     116:</span> <span class="k">  retain a reference and the reference count of the object has already</span>
<a name="117" /><span class="True">     117:</span> <span class="k">  been incremented to account for this fact.  A caller that does not</span>
<a name="118" /><span class="True">     118:</span> <span class="k">  retain a reference to an object that is returned from a function</span>
<a name="119" /><span class="True">     119:</span> <span class="k">  must decrement the reference count of the object (using</span>
<a name="120" /><span class="True">     120:</span> <span class="k">  DECREF(object)) to prevent memory leaks.</span>
<a name="121" /><span class="True">     121:</span> <span class="k"></span>
<a name="122" /><span class="True">     122:</span> <span class="k">  Note that the behavior mentioned here is different from the current</span>
<a name="123" /><span class="True">     123:</span> <span class="k">  behavior for some objects (e.g. lists and tuples) when certain</span>
<a name="124" /><span class="True">     124:</span> <span class="k">  type-specific routines are called directly (e.g. setlistitem).  The</span>
<a name="125" /><span class="True">     125:</span> <span class="k">  proposed abstraction layer will provide a consistent memory</span>
<a name="126" /><span class="True">     126:</span> <span class="k">  management interface, correcting for inconsistent behavior for some</span>
<a name="127" /><span class="True">     127:</span> <span class="k">  built-in types.</span>
<a name="128" /><span class="True">     128:</span> <span class="k"></span>
<a name="129" /><span class="True">     129:</span> <span class="k">Protocols</span>
<a name="130" /><span class="True">     130:</span> <span class="k"></span>
<a name="131" /><span class="True">     131:</span> <span class="k">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/</span>
<a name="132" /><span class="True">     132:</span> 
<a name="133" /><span class="True">     133:</span> <span class="k">/*  Object Protocol: */</span>
<a name="134" /><span class="True">     134:</span> 
<a name="135" /><span class="True">     135:</span>      <span class="k">/* Implemented elsewhere:</span>
<a name="136" /><span class="True">     136:</span> <span class="k"></span>
<a name="137" /><span class="True">     137:</span> <span class="k">     int PyObject_Print(PyObject *o, FILE *fp, int flags);</span>
<a name="138" /><span class="True">     138:</span> <span class="k"></span>
<a name="139" /><span class="True">     139:</span> <span class="k">     Print an object, o, on file, fp.  Returns -1 on</span>
<a name="140" /><span class="True">     140:</span> <span class="k">     error.  The flags argument is used to enable certain printing</span>
<a name="141" /><span class="True">     141:</span> <span class="k">     options. The only option currently supported is Py_Print_RAW.</span>
<a name="142" /><span class="True">     142:</span> <span class="k"></span>
<a name="143" /><span class="True">     143:</span> <span class="k">     (What should be said about Py_Print_RAW?)</span>
<a name="144" /><span class="True">     144:</span> <span class="k"></span>
<a name="145" /><span class="True">     145:</span> <span class="k">       */</span>
<a name="146" /><span class="True">     146:</span> 
<a name="147" /><span class="True">     147:</span>      <span class="k">/* Implemented elsewhere:</span>
<a name="148" /><span class="True">     148:</span> <span class="k"></span>
<a name="149" /><span class="True">     149:</span> <span class="k">     int PyObject_HasAttrString(PyObject *o, const char *attr_name);</span>
<a name="150" /><span class="True">     150:</span> <span class="k"></span>
<a name="151" /><span class="True">     151:</span> <span class="k">     Returns 1 if o has the attribute attr_name, and 0 otherwise.</span>
<a name="152" /><span class="True">     152:</span> <span class="k">     This is equivalent to the Python expression:</span>
<a name="153" /><span class="True">     153:</span> <span class="k">     hasattr(o,attr_name).</span>
<a name="154" /><span class="True">     154:</span> <span class="k"></span>
<a name="155" /><span class="True">     155:</span> <span class="k">     This function always succeeds.</span>
<a name="156" /><span class="True">     156:</span> <span class="k"></span>
<a name="157" /><span class="True">     157:</span> <span class="k">       */</span>
<a name="158" /><span class="True">     158:</span> 
<a name="159" /><span class="True">     159:</span>      <span class="k">/* Implemented elsewhere:</span>
<a name="160" /><span class="True">     160:</span> <span class="k"></span>
<a name="161" /><span class="True">     161:</span> <span class="k">     PyObject* PyObject_GetAttrString(PyObject *o, const char *attr_name);</span>
<a name="162" /><span class="True">     162:</span> <span class="k"></span>
<a name="163" /><span class="True">     163:</span> <span class="k">     Retrieve an attributed named attr_name form object o.</span>
<a name="164" /><span class="True">     164:</span> <span class="k">     Returns the attribute value on success, or NULL on failure.</span>
<a name="165" /><span class="True">     165:</span> <span class="k">     This is the equivalent of the Python expression: o.attr_name.</span>
<a name="166" /><span class="True">     166:</span> <span class="k"></span>
<a name="167" /><span class="True">     167:</span> <span class="k">       */</span>
<a name="168" /><span class="True">     168:</span> 
<a name="169" /><span class="True">     169:</span>      <span class="k">/* Implemented elsewhere:</span>
<a name="170" /><span class="True">     170:</span> <span class="k"></span>
<a name="171" /><span class="True">     171:</span> <span class="k">     int PyObject_HasAttr(PyObject *o, PyObject *attr_name);</span>
<a name="172" /><span class="True">     172:</span> <span class="k"></span>
<a name="173" /><span class="True">     173:</span> <span class="k">     Returns 1 if o has the attribute attr_name, and 0 otherwise.</span>
<a name="174" /><span class="True">     174:</span> <span class="k">     This is equivalent to the Python expression:</span>
<a name="175" /><span class="True">     175:</span> <span class="k">     hasattr(o,attr_name).</span>
<a name="176" /><span class="True">     176:</span> <span class="k"></span>
<a name="177" /><span class="True">     177:</span> <span class="k">     This function always succeeds.</span>
<a name="178" /><span class="True">     178:</span> <span class="k"></span>
<a name="179" /><span class="True">     179:</span> <span class="k">       */</span>
<a name="180" /><span class="True">     180:</span> 
<a name="181" /><span class="True">     181:</span>      <span class="k">/* Implemented elsewhere:</span>
<a name="182" /><span class="True">     182:</span> <span class="k"></span>
<a name="183" /><span class="True">     183:</span> <span class="k">     PyObject* PyObject_GetAttr(PyObject *o, PyObject *attr_name);</span>
<a name="184" /><span class="True">     184:</span> <span class="k"></span>
<a name="185" /><span class="True">     185:</span> <span class="k">     Retrieve an attributed named attr_name form object o.</span>
<a name="186" /><span class="True">     186:</span> <span class="k">     Returns the attribute value on success, or NULL on failure.</span>
<a name="187" /><span class="True">     187:</span> <span class="k">     This is the equivalent of the Python expression: o.attr_name.</span>
<a name="188" /><span class="True">     188:</span> <span class="k"></span>
<a name="189" /><span class="True">     189:</span> <span class="k">       */</span>
<a name="190" /><span class="True">     190:</span> 
<a name="191" /><span class="True">     191:</span> 
<a name="192" /><span class="True">     192:</span>      <span class="k">/* Implemented elsewhere:</span>
<a name="193" /><span class="True">     193:</span> <span class="k"></span>
<a name="194" /><span class="True">     194:</span> <span class="k">     int PyObject_SetAttrString(PyObject *o, const char *attr_name, PyObject *v);</span>
<a name="195" /><span class="True">     195:</span> <span class="k"></span>
<a name="196" /><span class="True">     196:</span> <span class="k">     Set the value of the attribute named attr_name, for object o,</span>
<a name="197" /><span class="True">     197:</span> <span class="k">     to the value v. Raise an exception and return -1 on failure; return 0 on</span>
<a name="198" /><span class="True">     198:</span> <span class="k">     success.  This is the equivalent of the Python statement o.attr_name=v.</span>
<a name="199" /><span class="True">     199:</span> <span class="k"></span>
<a name="200" /><span class="True">     200:</span> <span class="k">       */</span>
<a name="201" /><span class="True">     201:</span> 
<a name="202" /><span class="True">     202:</span>      <span class="k">/* Implemented elsewhere:</span>
<a name="203" /><span class="True">     203:</span> <span class="k"></span>
<a name="204" /><span class="True">     204:</span> <span class="k">     int PyObject_SetAttr(PyObject *o, PyObject *attr_name, PyObject *v);</span>
<a name="205" /><span class="True">     205:</span> <span class="k"></span>
<a name="206" /><span class="True">     206:</span> <span class="k">     Set the value of the attribute named attr_name, for object o,</span>
<a name="207" /><span class="True">     207:</span> <span class="k">     to the value v. Raise an exception and return -1 on failure; return 0 on</span>
<a name="208" /><span class="True">     208:</span> <span class="k">     success.  This is the equivalent of the Python statement o.attr_name=v.</span>
<a name="209" /><span class="True">     209:</span> <span class="k"></span>
<a name="210" /><span class="True">     210:</span> <span class="k">       */</span>
<a name="211" /><span class="True">     211:</span> 
<a name="212" /><span class="True">     212:</span>      <span class="k">/* implemented as a macro:</span>
<a name="213" /><span class="True">     213:</span> <span class="k"></span>
<a name="214" /><span class="True">     214:</span> <span class="k">     int PyObject_DelAttrString(PyObject *o, const char *attr_name);</span>
<a name="215" /><span class="True">     215:</span> <span class="k"></span>
<a name="216" /><span class="True">     216:</span> <span class="k">     Delete attribute named attr_name, for object o. Returns</span>
<a name="217" /><span class="True">     217:</span> <span class="k">     -1 on failure.  This is the equivalent of the Python</span>
<a name="218" /><span class="True">     218:</span> <span class="k">     statement: del o.attr_name.</span>
<a name="219" /><span class="True">     219:</span> <span class="k"></span>
<a name="220" /><span class="True">     220:</span> <span class="k">       */</span>
<a name="221" /><span class="True">     221:</span> <span class="f">#</span><span class="n">define</span>  <a href="macros_noref.html#_UHlPYmplY3RfRGVsQXR0clN0cmluZ18w"><span class="b">PyObject_DelAttrString</span></a><span class="f">(</span><span class="b">O</span><span class="f">,</span><span class="b">A</span><span class="f">)</span> <span class="b">PyObject_SetAttrString</span><span class="f">(</span><span class="f">(</span><span class="b">O</span><span class="f">)</span><span class="f">,</span><span class="f">(</span><span class="b">A</span><span class="f">)</span><span class="f">,</span><a href="macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a><span class="f">)</span>
<a name="222" /><span class="True">     222:</span> 
<a name="223" /><span class="True">     223:</span>      <span class="k">/* implemented as a macro:</span>
<a name="224" /><span class="True">     224:</span> <span class="k"></span>
<a name="225" /><span class="True">     225:</span> <span class="k">     int PyObject_DelAttr(PyObject *o, PyObject *attr_name);</span>
<a name="226" /><span class="True">     226:</span> <span class="k"></span>
<a name="227" /><span class="True">     227:</span> <span class="k">     Delete attribute named attr_name, for object o. Returns -1</span>
<a name="228" /><span class="True">     228:</span> <span class="k">     on failure.  This is the equivalent of the Python</span>
<a name="229" /><span class="True">     229:</span> <span class="k">     statement: del o.attr_name.</span>
<a name="230" /><span class="True">     230:</span> <span class="k"></span>
<a name="231" /><span class="True">     231:</span> <span class="k">       */</span>
<a name="232" /><span class="True">     232:</span> <span class="f">#</span><span class="n">define</span>  <a href="macros_noref.html#_UHlPYmplY3RfRGVsQXR0cl8w"><span class="b">PyObject_DelAttr</span></a><span class="f">(</span><span class="b">O</span><span class="f">,</span><span class="b">A</span><span class="f">)</span> <span class="b">PyObject_SetAttr</span><span class="f">(</span><span class="f">(</span><span class="b">O</span><span class="f">)</span><span class="f">,</span><span class="f">(</span><span class="b">A</span><span class="f">)</span><span class="f">,</span><a href="macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a><span class="f">)</span>
<a name="233" /><span class="True">     233:</span> 
<a name="234" /><span class="True">     234:</span>      <span class="k">/* Implemented elsewhere:</span>
<a name="235" /><span class="True">     235:</span> <span class="k"></span>
<a name="236" /><span class="True">     236:</span> <span class="k">     PyObject *PyObject_Repr(PyObject *o);</span>
<a name="237" /><span class="True">     237:</span> <span class="k"></span>
<a name="238" /><span class="True">     238:</span> <span class="k">     Compute the string representation of object, o.  Returns the</span>
<a name="239" /><span class="True">     239:</span> <span class="k">     string representation on success, NULL on failure.  This is</span>
<a name="240" /><span class="True">     240:</span> <span class="k">     the equivalent of the Python expression: repr(o).</span>
<a name="241" /><span class="True">     241:</span> <span class="k"></span>
<a name="242" /><span class="True">     242:</span> <span class="k">     Called by the repr() built-in function.</span>
<a name="243" /><span class="True">     243:</span> <span class="k"></span>
<a name="244" /><span class="True">     244:</span> <span class="k">       */</span>
<a name="245" /><span class="True">     245:</span> 
<a name="246" /><span class="True">     246:</span>      <span class="k">/* Implemented elsewhere:</span>
<a name="247" /><span class="True">     247:</span> <span class="k"></span>
<a name="248" /><span class="True">     248:</span> <span class="k">     PyObject *PyObject_Str(PyObject *o);</span>
<a name="249" /><span class="True">     249:</span> <span class="k"></span>
<a name="250" /><span class="True">     250:</span> <span class="k">     Compute the string representation of object, o.  Returns the</span>
<a name="251" /><span class="True">     251:</span> <span class="k">     string representation on success, NULL on failure.  This is</span>
<a name="252" /><span class="True">     252:</span> <span class="k">     the equivalent of the Python expression: str(o).)</span>
<a name="253" /><span class="True">     253:</span> <span class="k"></span>
<a name="254" /><span class="True">     254:</span> <span class="k">     Called by the str() and print() built-in functions.</span>
<a name="255" /><span class="True">     255:</span> <span class="k"></span>
<a name="256" /><span class="True">     256:</span> <span class="k">       */</span>
<a name="257" /><span class="True">     257:</span> 
<a name="258" /><span class="True">     258:</span>        <span class="k">/* Declared elsewhere</span>
<a name="259" /><span class="True">     259:</span> <span class="k"></span>
<a name="260" /><span class="True">     260:</span> <span class="k">     PyAPI_FUNC(int) PyCallable_Check(PyObject *o);</span>
<a name="261" /><span class="True">     261:</span> <span class="k"></span>
<a name="262" /><span class="True">     262:</span> <span class="k">     Determine if the object, o, is callable.  Return 1 if the</span>
<a name="263" /><span class="True">     263:</span> <span class="k">     object is callable and 0 otherwise.</span>
<a name="264" /><span class="True">     264:</span> <span class="k"></span>
<a name="265" /><span class="True">     265:</span> <span class="k">     This function always succeeds.</span>
<a name="266" /><span class="True">     266:</span> <span class="k">       */</span>
<a name="267" /><span class="True">     267:</span> 
<a name="268" /><span class="True">     268:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyObject_Call</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">callable_object</span><span class="f">,</span>
<a name="269" /><span class="True">     269:</span>                                           <span class="b">PyObject</span> <span class="f">*</span><span class="b">args</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">kwargs</span><span class="f">)</span><span class="f">;</span>
<a name="270" /><span class="True">     270:</span> 
<a name="271" /><span class="True">     271:</span>        <span class="k">/*</span>
<a name="272" /><span class="True">     272:</span> <span class="k">     Call a callable Python object, callable_object, with</span>
<a name="273" /><span class="True">     273:</span> <span class="k">     arguments and keywords arguments.  The &apos;args&apos; argument can not be</span>
<a name="274" /><span class="True">     274:</span> <span class="k">     NULL.</span>
<a name="275" /><span class="True">     275:</span> <span class="k">       */</span>
<a name="276" /><span class="True">     276:</span> 
<a name="277" /><span class="True">     277:</span> <span class="f">#</span><span class="n">ifndef</span> <span class="b">Py_LIMITED_API</span>
<a name="278" /><span class="True">     278:</span>     <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span><span class="f">*</span><span class="f">)</span> <span class="b">_PyStack_AsTuple</span><span class="f">(</span>
<a name="279" /><span class="True">     279:</span>         <span class="b">PyObject</span> <span class="f">*</span><span class="f">*</span><span class="b">stack</span><span class="f">,</span>
<a name="280" /><span class="True">     280:</span>         <span class="b">Py_ssize_t</span> <span class="b">nargs</span><span class="f">)</span><span class="f">;</span>
<a name="281" /><span class="True">     281:</span> 
<a name="282" /><span class="True">     282:</span>     <span class="k">/* Convert keyword arguments from the (stack, kwnames) format to a Python</span>
<a name="283" /><span class="True">     283:</span> <span class="k">       dictionary.</span>
<a name="284" /><span class="True">     284:</span> <span class="k"></span>
<a name="285" /><span class="True">     285:</span> <span class="k">       kwnames must only contains str strings, no subclass, and all keys must</span>
<a name="286" /><span class="True">     286:</span> <span class="k">       be unique. kwnames is not checked, usually these checks are done before or later</span>
<a name="287" /><span class="True">     287:</span> <span class="k">       calling _PyStack_AsDict(). For example, _PyArg_ParseStack() raises an</span>
<a name="288" /><span class="True">     288:</span> <span class="k">       error if a key is not a string. */</span>
<a name="289" /><span class="True">     289:</span>     <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">_PyStack_AsDict</span><span class="f">(</span>
<a name="290" /><span class="True">     290:</span>         <span class="b">PyObject</span> <span class="f">*</span><span class="f">*</span><span class="b">values</span><span class="f">,</span>
<a name="291" /><span class="True">     291:</span>         <span class="b">PyObject</span> <span class="f">*</span><span class="b">kwnames</span><span class="f">)</span><span class="f">;</span>
<a name="292" /><span class="True">     292:</span> 
<a name="293" /><span class="True">     293:</span>     <span class="k">/* Convert (args, nargs, kwargs: dict) into (stack, nargs, kwnames: tuple).</span>
<a name="294" /><span class="True">     294:</span> <span class="k"></span>
<a name="295" /><span class="True">     295:</span> <span class="k">       Return 0 on success, raise an exception and return -1 on error.</span>
<a name="296" /><span class="True">     296:</span> <span class="k"></span>
<a name="297" /><span class="True">     297:</span> <span class="k">       Write the new stack into *p_stack. If *p_stack is differen than args, it</span>
<a name="298" /><span class="True">     298:</span> <span class="k">       must be released by PyMem_Free().</span>
<a name="299" /><span class="True">     299:</span> <span class="k"></span>
<a name="300" /><span class="True">     300:</span> <span class="k">       The stack uses borrowed references.</span>
<a name="301" /><span class="True">     301:</span> <span class="k"></span>
<a name="302" /><span class="True">     302:</span> <span class="k">       The type of keyword keys is not checked, these checks should be done</span>
<a name="303" /><span class="True">     303:</span> <span class="k">       later (ex: _PyArg_ParseStackAndKeywords). */</span>
<a name="304" /><span class="True">     304:</span>     <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">_PyStack_UnpackDict</span><span class="f">(</span>
<a name="305" /><span class="True">     305:</span>         <span class="b">PyObject</span> <span class="f">*</span><span class="f">*</span><span class="b">args</span><span class="f">,</span>
<a name="306" /><span class="True">     306:</span>         <span class="b">Py_ssize_t</span> <span class="b">nargs</span><span class="f">,</span>
<a name="307" /><span class="True">     307:</span>         <span class="b">PyObject</span> <span class="f">*</span><span class="b">kwargs</span><span class="f">,</span>
<a name="308" /><span class="True">     308:</span>         <span class="b">PyObject</span> <span class="f">*</span><span class="f">*</span><span class="f">*</span><span class="b">p_stack</span><span class="f">,</span>
<a name="309" /><span class="True">     309:</span>         <span class="b">PyObject</span> <span class="f">*</span><span class="f">*</span><span class="b">p_kwnames</span><span class="f">)</span><span class="f">;</span>
<a name="310" /><span class="True">     310:</span> 
<a name="311" /><span class="True">     311:</span>     <span class="k">/* Call the callable object func with the &quot;fast call&quot; calling convention:</span>
<a name="312" /><span class="True">     312:</span> <span class="k">       args is a C array for positional arguments (nargs is the number of</span>
<a name="313" /><span class="True">     313:</span> <span class="k">       positional arguments), kwargs is a dictionary for keyword arguments.</span>
<a name="314" /><span class="True">     314:</span> <span class="k"></span>
<a name="315" /><span class="True">     315:</span> <span class="k">       If nargs is equal to zero, args can be NULL. kwargs can be NULL.</span>
<a name="316" /><span class="True">     316:</span> <span class="k">       nargs must be greater or equal to zero.</span>
<a name="317" /><span class="True">     317:</span> <span class="k"></span>
<a name="318" /><span class="True">     318:</span> <span class="k">       Return the result on success. Raise an exception on return NULL on</span>
<a name="319" /><span class="True">     319:</span> <span class="k">       error. */</span>
<a name="320" /><span class="True">     320:</span>     <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">_PyObject_FastCallDict</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">func</span><span class="f">,</span>
<a name="321" /><span class="True">     321:</span>                                                   <span class="b">PyObject</span> <span class="f">*</span><span class="f">*</span><span class="b">args</span><span class="f">,</span> <span class="b">Py_ssize_t</span> <span class="b">nargs</span><span class="f">,</span>
<a name="322" /><span class="True">     322:</span>                                                   <span class="b">PyObject</span> <span class="f">*</span><span class="b">kwargs</span><span class="f">)</span><span class="f">;</span>
<a name="323" /><span class="True">     323:</span> 
<a name="324" /><span class="True">     324:</span>     <span class="k">/* Call the callable object func with the &quot;fast call&quot; calling convention:</span>
<a name="325" /><span class="True">     325:</span> <span class="k">       args is a C array for positional arguments followed by values of</span>
<a name="326" /><span class="True">     326:</span> <span class="k">       keyword arguments. Keys of keyword arguments are stored as a tuple</span>
<a name="327" /><span class="True">     327:</span> <span class="k">       of strings in kwnames. nargs is the number of positional parameters at</span>
<a name="328" /><span class="True">     328:</span> <span class="k">       the beginning of stack. The size of kwnames gives the number of keyword</span>
<a name="329" /><span class="True">     329:</span> <span class="k">       values in the stack after positional arguments.</span>
<a name="330" /><span class="True">     330:</span> <span class="k"></span>
<a name="331" /><span class="True">     331:</span> <span class="k">       kwnames must only contains str strings, no subclass, and all keys must</span>
<a name="332" /><span class="True">     332:</span> <span class="k">       be unique.</span>
<a name="333" /><span class="True">     333:</span> <span class="k"></span>
<a name="334" /><span class="True">     334:</span> <span class="k">       If nargs is equal to zero and there is no keyword argument (kwnames is</span>
<a name="335" /><span class="True">     335:</span> <span class="k">       NULL or its size is zero), args can be NULL.</span>
<a name="336" /><span class="True">     336:</span> <span class="k"></span>
<a name="337" /><span class="True">     337:</span> <span class="k">       Return the result on success. Raise an exception and return NULL on</span>
<a name="338" /><span class="True">     338:</span> <span class="k">       error. */</span>
<a name="339" /><span class="True">     339:</span>     <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">_PyObject_FastCallKeywords</span>
<a name="340" /><span class="True">     340:</span>        <span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">func</span><span class="f">,</span>
<a name="341" /><span class="True">     341:</span>         <span class="b">PyObject</span> <span class="f">*</span><span class="f">*</span><span class="b">args</span><span class="f">,</span>
<a name="342" /><span class="True">     342:</span>         <span class="b">Py_ssize_t</span> <span class="b">nargs</span><span class="f">,</span>
<a name="343" /><span class="True">     343:</span>         <span class="b">PyObject</span> <span class="f">*</span><span class="b">kwnames</span><span class="f">)</span><span class="f">;</span>
<a name="344" /><span class="True">     344:</span> 
<a name="345" /><span class="True">     345:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_X1B5T2JqZWN0X0Zhc3RDYWxsXzA_"><span class="b">_PyObject_FastCall</span></a><span class="f">(</span><span class="b">func</span><span class="f">,</span> <span class="b">args</span><span class="f">,</span> <span class="b">nargs</span><span class="f">)</span> \
<a name="346" /><span class="True">     346:</span>     <span class="b">_PyObject_FastCallDict</span><span class="f">(</span><span class="f">(</span><span class="b">func</span><span class="f">)</span><span class="f">,</span> <span class="f">(</span><span class="b">args</span><span class="f">)</span><span class="f">,</span> <span class="f">(</span><span class="b">nargs</span><span class="f">)</span><span class="f">,</span> <a href="macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a><span class="f">)</span>
<a name="347" /><span class="True">     347:</span> 
<a name="348" /><span class="True">     348:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_X1B5T2JqZWN0X0NhbGxOb0FyZ18w"><span class="b">_PyObject_CallNoArg</span></a><span class="f">(</span><span class="b">func</span><span class="f">)</span> \
<a name="349" /><span class="True">     349:</span>     <a href="macros_noref.html#_X1B5T2JqZWN0X0Zhc3RDYWxsXzA_"><span class="b">_PyObject_FastCall</span></a><span class="f">(</span><span class="f">(</span><span class="b">func</span><span class="f">)</span><span class="f">,</span> <a href="macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a><span class="f">,</span> <span class="c">0</span><span class="f">)</span>
<a name="350" /><span class="True">     350:</span> 
<a name="351" /><span class="True">     351:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_X1B5T2JqZWN0X0NhbGxBcmcxXzA_"><span class="b">_PyObject_CallArg1</span></a><span class="f">(</span><span class="b">func</span><span class="f">,</span> <span class="b">arg</span><span class="f">)</span> \
<a name="352" /><span class="True">     352:</span>     <a href="macros_noref.html#_X1B5T2JqZWN0X0Zhc3RDYWxsXzA_"><span class="b">_PyObject_FastCall</span></a><span class="f">(</span><span class="f">(</span><span class="b">func</span><span class="f">)</span><span class="f">,</span> <span class="f">&amp;</span><span class="f">(</span><span class="b">arg</span><span class="f">)</span><span class="f">,</span> <span class="c">1</span><span class="f">)</span>
<a name="353" /><span class="True">     353:</span> 
<a name="354" /><span class="True">     354:</span>     <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">_PyObject_Call_Prepend</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">func</span><span class="f">,</span>
<a name="355" /><span class="True">     355:</span>                                                   <span class="b">PyObject</span> <span class="f">*</span><span class="b">obj</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">args</span><span class="f">,</span>
<a name="356" /><span class="True">     356:</span>                                                   <span class="b">PyObject</span> <span class="f">*</span><span class="b">kwargs</span><span class="f">)</span><span class="f">;</span>
<a name="357" /><span class="True">     357:</span> 
<a name="358" /><span class="True">     358:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">_Py_CheckFunctionResult</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">func</span><span class="f">,</span>
<a name="359" /><span class="True">     359:</span>                                                     <span class="b">PyObject</span> <span class="f">*</span><span class="b">result</span><span class="f">,</span>
<a name="360" /><span class="True">     360:</span>                                                     <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">where</span><span class="f">)</span><span class="f">;</span>
<a name="361" /><span class="True">     361:</span> <span class="f">#</span><span class="n">endif</span>   <span class="k">/* Py_LIMITED_API */</span>
<a name="362" /><span class="True">     362:</span> 
<a name="363" /><span class="True">     363:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyObject_CallObject</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">callable_object</span><span class="f">,</span>
<a name="364" /><span class="True">     364:</span>                                                 <span class="b">PyObject</span> <span class="f">*</span><span class="b">args</span><span class="f">)</span><span class="f">;</span>
<a name="365" /><span class="True">     365:</span> 
<a name="366" /><span class="True">     366:</span>        <span class="k">/*</span>
<a name="367" /><span class="True">     367:</span> <span class="k">     Call a callable Python object, callable_object, with</span>
<a name="368" /><span class="True">     368:</span> <span class="k">     arguments given by the tuple, args.  If no arguments are</span>
<a name="369" /><span class="True">     369:</span> <span class="k">     needed, then args may be NULL.  Returns the result of the</span>
<a name="370" /><span class="True">     370:</span> <span class="k">     call on success, or NULL on failure.  This is the equivalent</span>
<a name="371" /><span class="True">     371:</span> <span class="k">     of the Python expression: o(*args).</span>
<a name="372" /><span class="True">     372:</span> <span class="k">       */</span>
<a name="373" /><span class="True">     373:</span> 
<a name="374" /><span class="True">     374:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyObject_CallFunction</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">callable_object</span><span class="f">,</span>
<a name="375" /><span class="True">     375:</span>                                                   <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">format</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span><span class="f">;</span>
<a name="376" /><span class="True">     376:</span> 
<a name="377" /><span class="True">     377:</span>        <span class="k">/*</span>
<a name="378" /><span class="True">     378:</span> <span class="k">     Call a callable Python object, callable_object, with a</span>
<a name="379" /><span class="True">     379:</span> <span class="k">     variable number of C arguments. The C arguments are described</span>
<a name="380" /><span class="True">     380:</span> <span class="k">     using a mkvalue-style format string. The format may be NULL,</span>
<a name="381" /><span class="True">     381:</span> <span class="k">     indicating that no arguments are provided.  Returns the</span>
<a name="382" /><span class="True">     382:</span> <span class="k">     result of the call on success, or NULL on failure.  This is</span>
<a name="383" /><span class="True">     383:</span> <span class="k">     the equivalent of the Python expression: o(*args).</span>
<a name="384" /><span class="True">     384:</span> <span class="k">       */</span>
<a name="385" /><span class="True">     385:</span> 
<a name="386" /><span class="True">     386:</span> 
<a name="387" /><span class="True">     387:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyObject_CallMethod</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">,</span>
<a name="388" /><span class="True">     388:</span>                                                 <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">method</span><span class="f">,</span>
<a name="389" /><span class="True">     389:</span>                                                 <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">format</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span><span class="f">;</span>
<a name="390" /><span class="True">     390:</span> 
<a name="391" /><span class="True">     391:</span>        <span class="k">/*</span>
<a name="392" /><span class="True">     392:</span> <span class="k">     Call the method named m of object o with a variable number of</span>
<a name="393" /><span class="True">     393:</span> <span class="k">     C arguments.  The C arguments are described by a mkvalue</span>
<a name="394" /><span class="True">     394:</span> <span class="k">     format string.  The format may be NULL, indicating that no</span>
<a name="395" /><span class="True">     395:</span> <span class="k">     arguments are provided. Returns the result of the call on</span>
<a name="396" /><span class="True">     396:</span> <span class="k">     success, or NULL on failure.  This is the equivalent of the</span>
<a name="397" /><span class="True">     397:</span> <span class="k">     Python expression: o.method(args).</span>
<a name="398" /><span class="True">     398:</span> <span class="k">       */</span>
<a name="399" /><span class="True">     399:</span> 
<a name="400" /><span class="True">     400:</span> <span class="f">#</span><span class="n">ifndef</span> <span class="b">Py_LIMITED_API</span>
<a name="401" /><span class="True">     401:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">_PyObject_CallMethodId</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">,</span>
<a name="402" /><span class="True">     402:</span>                                                    <span class="b">_Py_Identifier</span> <span class="f">*</span><span class="b">method</span><span class="f">,</span>
<a name="403" /><span class="True">     403:</span>                                                    <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">format</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span><span class="f">;</span>
<a name="404" /><span class="True">     404:</span> 
<a name="405" /><span class="True">     405:</span>        <span class="k">/*</span>
<a name="406" /><span class="True">     406:</span> <span class="k">         Like PyObject_CallMethod, but expect a _Py_Identifier* as the</span>
<a name="407" /><span class="True">     407:</span> <span class="k">         method name.</span>
<a name="408" /><span class="True">     408:</span> <span class="k">       */</span>
<a name="409" /><span class="True">     409:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* !Py_LIMITED_API */</span>
<a name="410" /><span class="True">     410:</span> 
<a name="411" /><span class="True">     411:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">_PyObject_CallFunction_SizeT</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">callable</span><span class="f">,</span>
<a name="412" /><span class="True">     412:</span>                                                          <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">format</span><span class="f">,</span>
<a name="413" /><span class="True">     413:</span>                                                          <span class="f">...</span><span class="f">)</span><span class="f">;</span>
<a name="414" /><span class="True">     414:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">_PyObject_CallMethod_SizeT</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">,</span>
<a name="415" /><span class="True">     415:</span>                                                        <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">name</span><span class="f">,</span>
<a name="416" /><span class="True">     416:</span>                                                        <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">format</span><span class="f">,</span>
<a name="417" /><span class="True">     417:</span>                                                        <span class="f">...</span><span class="f">)</span><span class="f">;</span>
<a name="418" /><span class="True">     418:</span> <span class="f">#</span><span class="n">ifndef</span> <span class="b">Py_LIMITED_API</span>
<a name="419" /><span class="True">     419:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">_PyObject_CallMethodId_SizeT</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">,</span>
<a name="420" /><span class="True">     420:</span>                                                        <span class="b">_Py_Identifier</span> <span class="f">*</span><span class="b">name</span><span class="f">,</span>
<a name="421" /><span class="True">     421:</span>                                                        <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">format</span><span class="f">,</span>
<a name="422" /><span class="True">     422:</span>                                                        <span class="f">...</span><span class="f">)</span><span class="f">;</span>
<a name="423" /><span class="True">     423:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* !Py_LIMITED_API */</span>
<a name="424" /><span class="True">     424:</span> 
<a name="425" /><span class="True">     425:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyObject_CallFunctionObjArgs</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">callable</span><span class="f">,</span>
<a name="426" /><span class="True">     426:</span>                                                          <span class="f">...</span><span class="f">)</span><span class="f">;</span>
<a name="427" /><span class="True">     427:</span> 
<a name="428" /><span class="True">     428:</span>        <span class="k">/*</span>
<a name="429" /><span class="True">     429:</span> <span class="k">     Call a callable Python object, callable_object, with a</span>
<a name="430" /><span class="True">     430:</span> <span class="k">     variable number of C arguments.  The C arguments are provided</span>
<a name="431" /><span class="True">     431:</span> <span class="k">     as PyObject * values, terminated by a NULL.  Returns the</span>
<a name="432" /><span class="True">     432:</span> <span class="k">     result of the call on success, or NULL on failure.  This is</span>
<a name="433" /><span class="True">     433:</span> <span class="k">     the equivalent of the Python expression: o(*args).</span>
<a name="434" /><span class="True">     434:</span> <span class="k">       */</span>
<a name="435" /><span class="True">     435:</span> 
<a name="436" /><span class="True">     436:</span> 
<a name="437" /><span class="True">     437:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyObject_CallMethodObjArgs</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">,</span>
<a name="438" /><span class="True">     438:</span>                                                        <span class="b">PyObject</span> <span class="f">*</span><span class="b">method</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span><span class="f">;</span>
<a name="439" /><span class="True">     439:</span> <span class="f">#</span><span class="n">ifndef</span> <span class="b">Py_LIMITED_API</span>
<a name="440" /><span class="True">     440:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">_PyObject_CallMethodIdObjArgs</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">,</span>
<a name="441" /><span class="True">     441:</span>                                                <span class="m">struct</span> <span class="b">_Py_Identifier</span> <span class="f">*</span><span class="b">method</span><span class="f">,</span>
<a name="442" /><span class="True">     442:</span>                                                <span class="f">...</span><span class="f">)</span><span class="f">;</span>
<a name="443" /><span class="True">     443:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* !Py_LIMITED_API */</span>
<a name="444" /><span class="True">     444:</span> 
<a name="445" /><span class="True">     445:</span>        <span class="k">/*</span>
<a name="446" /><span class="True">     446:</span> <span class="k">     Call the method named m of object o with a variable number of</span>
<a name="447" /><span class="True">     447:</span> <span class="k">     C arguments.  The C arguments are provided as PyObject *</span>
<a name="448" /><span class="True">     448:</span> <span class="k">     values, terminated by NULL.  Returns the result of the call</span>
<a name="449" /><span class="True">     449:</span> <span class="k">     on success, or NULL on failure.  This is the equivalent of</span>
<a name="450" /><span class="True">     450:</span> <span class="k">     the Python expression: o.method(args).</span>
<a name="451" /><span class="True">     451:</span> <span class="k">       */</span>
<a name="452" /><span class="True">     452:</span> 
<a name="453" /><span class="True">     453:</span> 
<a name="454" /><span class="True">     454:</span>      <span class="k">/* Implemented elsewhere:</span>
<a name="455" /><span class="True">     455:</span> <span class="k"></span>
<a name="456" /><span class="True">     456:</span> <span class="k">     long PyObject_Hash(PyObject *o);</span>
<a name="457" /><span class="True">     457:</span> <span class="k"></span>
<a name="458" /><span class="True">     458:</span> <span class="k">     Compute and return the hash, hash_value, of an object, o.  On</span>
<a name="459" /><span class="True">     459:</span> <span class="k">     failure, return -1.  This is the equivalent of the Python</span>
<a name="460" /><span class="True">     460:</span> <span class="k">     expression: hash(o).</span>
<a name="461" /><span class="True">     461:</span> <span class="k">       */</span>
<a name="462" /><span class="True">     462:</span> 
<a name="463" /><span class="True">     463:</span> 
<a name="464" /><span class="True">     464:</span>      <span class="k">/* Implemented elsewhere:</span>
<a name="465" /><span class="True">     465:</span> <span class="k"></span>
<a name="466" /><span class="True">     466:</span> <span class="k">     int PyObject_IsTrue(PyObject *o);</span>
<a name="467" /><span class="True">     467:</span> <span class="k"></span>
<a name="468" /><span class="True">     468:</span> <span class="k">     Returns 1 if the object, o, is considered to be true, 0 if o is</span>
<a name="469" /><span class="True">     469:</span> <span class="k">     considered to be false and -1 on failure. This is equivalent to the</span>
<a name="470" /><span class="True">     470:</span> <span class="k">     Python expression: not not o</span>
<a name="471" /><span class="True">     471:</span> <span class="k">       */</span>
<a name="472" /><span class="True">     472:</span> 
<a name="473" /><span class="True">     473:</span>      <span class="k">/* Implemented elsewhere:</span>
<a name="474" /><span class="True">     474:</span> <span class="k"></span>
<a name="475" /><span class="True">     475:</span> <span class="k">     int PyObject_Not(PyObject *o);</span>
<a name="476" /><span class="True">     476:</span> <span class="k"></span>
<a name="477" /><span class="True">     477:</span> <span class="k">     Returns 0 if the object, o, is considered to be true, 1 if o is</span>
<a name="478" /><span class="True">     478:</span> <span class="k">     considered to be false and -1 on failure. This is equivalent to the</span>
<a name="479" /><span class="True">     479:</span> <span class="k">     Python expression: not o</span>
<a name="480" /><span class="True">     480:</span> <span class="k">       */</span>
<a name="481" /><span class="True">     481:</span> 
<a name="482" /><span class="True">     482:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyObject_Type</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">)</span><span class="f">;</span>
<a name="483" /><span class="True">     483:</span> 
<a name="484" /><span class="True">     484:</span>        <span class="k">/*</span>
<a name="485" /><span class="True">     485:</span> <span class="k">     On success, returns a type object corresponding to the object</span>
<a name="486" /><span class="True">     486:</span> <span class="k">     type of object o. On failure, returns NULL.  This is</span>
<a name="487" /><span class="True">     487:</span> <span class="k">     equivalent to the Python expression: type(o).</span>
<a name="488" /><span class="True">     488:</span> <span class="k">       */</span>
<a name="489" /><span class="True">     489:</span> 
<a name="490" /><span class="True">     490:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">Py_ssize_t</span><span class="f">)</span> <span class="b">PyObject_Size</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">)</span><span class="f">;</span>
<a name="491" /><span class="True">     491:</span> 
<a name="492" /><span class="True">     492:</span>        <span class="k">/*</span>
<a name="493" /><span class="True">     493:</span> <span class="k">     Return the size of object o.  If the object, o, provides</span>
<a name="494" /><span class="True">     494:</span> <span class="k">     both sequence and mapping protocols, the sequence size is</span>
<a name="495" /><span class="True">     495:</span> <span class="k">     returned. On error, -1 is returned.  This is the equivalent</span>
<a name="496" /><span class="True">     496:</span> <span class="k">     to the Python expression: len(o).</span>
<a name="497" /><span class="True">     497:</span> <span class="k">       */</span>
<a name="498" /><span class="True">     498:</span> 
<a name="499" /><span class="True">     499:</span>        <span class="k">/* For DLL compatibility */</span>
<a name="500" /><span class="True">     500:</span> <span class="f">#</span><span class="n">undef</span> <a href="macros_noref.html#_UHlPYmplY3RfTGVuZ3RoXzA_"><span class="b">PyObject_Length</span></a>
<a name="501" /><span class="True">     501:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">Py_ssize_t</span><span class="f">)</span> <a href="macros_noref.html#_UHlPYmplY3RfTGVuZ3RoXzA_"><span class="b">PyObject_Length</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">)</span><span class="f">;</span>
<a name="502" /><span class="True">     502:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlPYmplY3RfTGVuZ3RoXzA_"><span class="b">PyObject_Length</span></a> <span class="b">PyObject_Size</span>
<a name="503" /><span class="True">     503:</span> 
<a name="504" /><span class="True">     504:</span> <span class="f">#</span><span class="n">ifndef</span> <span class="b">Py_LIMITED_API</span>
<a name="505" /><span class="True">     505:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">_PyObject_HasLen</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">)</span><span class="f">;</span>
<a name="506" /><span class="True">     506:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">Py_ssize_t</span><span class="f">)</span> <span class="b">PyObject_LengthHint</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">,</span> <span class="b">Py_ssize_t</span><span class="f">)</span><span class="f">;</span>
<a name="507" /><span class="True">     507:</span> <span class="f">#</span><span class="n">endif</span>
<a name="508" /><span class="True">     508:</span> 
<a name="509" /><span class="True">     509:</span>        <span class="k">/*</span>
<a name="510" /><span class="True">     510:</span> <span class="k">     Guess the size of object o using len(o) or o.__length_hint__().</span>
<a name="511" /><span class="True">     511:</span> <span class="k">     If neither of those return a non-negative value, then return the</span>
<a name="512" /><span class="True">     512:</span> <span class="k">     default value.  If one of the calls fails, this function returns -1.</span>
<a name="513" /><span class="True">     513:</span> <span class="k">       */</span>
<a name="514" /><span class="True">     514:</span> 
<a name="515" /><span class="True">     515:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyObject_GetItem</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">key</span><span class="f">)</span><span class="f">;</span>
<a name="516" /><span class="True">     516:</span> 
<a name="517" /><span class="True">     517:</span>        <span class="k">/*</span>
<a name="518" /><span class="True">     518:</span> <span class="k">     Return element of o corresponding to the object, key, or NULL</span>
<a name="519" /><span class="True">     519:</span> <span class="k">     on failure. This is the equivalent of the Python expression:</span>
<a name="520" /><span class="True">     520:</span> <span class="k">     o[key].</span>
<a name="521" /><span class="True">     521:</span> <span class="k">       */</span>
<a name="522" /><span class="True">     522:</span> 
<a name="523" /><span class="True">     523:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">PyObject_SetItem</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">key</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">v</span><span class="f">)</span><span class="f">;</span>
<a name="524" /><span class="True">     524:</span> 
<a name="525" /><span class="True">     525:</span>        <span class="k">/*</span>
<a name="526" /><span class="True">     526:</span> <span class="k">     Map the object key to the value v.  Raise an exception and return -1</span>
<a name="527" /><span class="True">     527:</span> <span class="k">     on failure; return 0 on success.  This is the equivalent of the Python</span>
<a name="528" /><span class="True">     528:</span> <span class="k">     statement o[key]=v.</span>
<a name="529" /><span class="True">     529:</span> <span class="k">       */</span>
<a name="530" /><span class="True">     530:</span> 
<a name="531" /><span class="True">     531:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">PyObject_DelItemString</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">,</span> <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">key</span><span class="f">)</span><span class="f">;</span>
<a name="532" /><span class="True">     532:</span> 
<a name="533" /><span class="True">     533:</span>        <span class="k">/*</span>
<a name="534" /><span class="True">     534:</span> <span class="k">     Remove the mapping for object, key, from the object *o.</span>
<a name="535" /><span class="True">     535:</span> <span class="k">     Returns -1 on failure.  This is equivalent to</span>
<a name="536" /><span class="True">     536:</span> <span class="k">     the Python statement: del o[key].</span>
<a name="537" /><span class="True">     537:</span> <span class="k">       */</span>
<a name="538" /><span class="True">     538:</span> 
<a name="539" /><span class="True">     539:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">PyObject_DelItem</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">key</span><span class="f">)</span><span class="f">;</span>
<a name="540" /><span class="True">     540:</span> 
<a name="541" /><span class="True">     541:</span>        <span class="k">/*</span>
<a name="542" /><span class="True">     542:</span> <span class="k">     Delete the mapping for key from *o.  Returns -1 on failure.</span>
<a name="543" /><span class="True">     543:</span> <span class="k">     This is the equivalent of the Python statement: del o[key].</span>
<a name="544" /><span class="True">     544:</span> <span class="k">       */</span>
<a name="545" /><span class="True">     545:</span> 
<a name="546" /><span class="True">     546:</span>     <span class="k">/* old buffer API</span>
<a name="547" /><span class="True">     547:</span> <span class="k">       FIXME:  usage of these should all be replaced in Python itself</span>
<a name="548" /><span class="True">     548:</span> <span class="k">       but for backwards compatibility we will implement them.</span>
<a name="549" /><span class="True">     549:</span> <span class="k">       Their usage without a corresponding &quot;unlock&quot; mechanism</span>
<a name="550" /><span class="True">     550:</span> <span class="k">       may create issues (but they would already be there). */</span>
<a name="551" /><span class="True">     551:</span> 
<a name="552" /><span class="True">     552:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">PyObject_AsCharBuffer</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">obj</span><span class="f">,</span>
<a name="553" /><span class="True">     553:</span>                                            <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="f">*</span><span class="b">buffer</span><span class="f">,</span>
<a name="554" /><span class="True">     554:</span>                                            <span class="b">Py_ssize_t</span> <span class="f">*</span><span class="b">buffer_len</span><span class="f">)</span><span class="f">;</span>
<a name="555" /><span class="True">     555:</span> 
<a name="556" /><span class="True">     556:</span>        <span class="k">/*</span>
<a name="557" /><span class="True">     557:</span> <span class="k">      Takes an arbitrary object which must support the (character,</span>
<a name="558" /><span class="True">     558:</span> <span class="k">      single segment) buffer interface and returns a pointer to a</span>
<a name="559" /><span class="True">     559:</span> <span class="k">      read-only memory location useable as character based input</span>
<a name="560" /><span class="True">     560:</span> <span class="k">      for subsequent processing.</span>
<a name="561" /><span class="True">     561:</span> <span class="k"></span>
<a name="562" /><span class="True">     562:</span> <span class="k">      0 is returned on success.  buffer and buffer_len are only</span>
<a name="563" /><span class="True">     563:</span> <span class="k">      set in case no error occurs. Otherwise, -1 is returned and</span>
<a name="564" /><span class="True">     564:</span> <span class="k">      an exception set.</span>
<a name="565" /><span class="True">     565:</span> <span class="k">       */</span>
<a name="566" /><span class="True">     566:</span> 
<a name="567" /><span class="True">     567:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">PyObject_CheckReadBuffer</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">obj</span><span class="f">)</span><span class="f">;</span>
<a name="568" /><span class="True">     568:</span> 
<a name="569" /><span class="True">     569:</span>       <span class="k">/*</span>
<a name="570" /><span class="True">     570:</span> <span class="k">      Checks whether an arbitrary object supports the (character,</span>
<a name="571" /><span class="True">     571:</span> <span class="k">      single segment) buffer interface.  Returns 1 on success, 0</span>
<a name="572" /><span class="True">     572:</span> <span class="k">      on failure.</span>
<a name="573" /><span class="True">     573:</span> <span class="k">      */</span>
<a name="574" /><span class="True">     574:</span> 
<a name="575" /><span class="True">     575:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">PyObject_AsReadBuffer</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">obj</span><span class="f">,</span>
<a name="576" /><span class="True">     576:</span>                                            <span class="m">const</span> <span class="m">void</span> <span class="f">*</span><span class="f">*</span><span class="b">buffer</span><span class="f">,</span>
<a name="577" /><span class="True">     577:</span>                                            <span class="b">Py_ssize_t</span> <span class="f">*</span><span class="b">buffer_len</span><span class="f">)</span><span class="f">;</span>
<a name="578" /><span class="True">     578:</span> 
<a name="579" /><span class="True">     579:</span>        <span class="k">/*</span>
<a name="580" /><span class="True">     580:</span> <span class="k">      Same as PyObject_AsCharBuffer() except that this API expects</span>
<a name="581" /><span class="True">     581:</span> <span class="k">      (readable, single segment) buffer interface and returns a</span>
<a name="582" /><span class="True">     582:</span> <span class="k">      pointer to a read-only memory location which can contain</span>
<a name="583" /><span class="True">     583:</span> <span class="k">      arbitrary data.</span>
<a name="584" /><span class="True">     584:</span> <span class="k"></span>
<a name="585" /><span class="True">     585:</span> <span class="k">      0 is returned on success.  buffer and buffer_len are only</span>
<a name="586" /><span class="True">     586:</span> <span class="k">      set in case no error occurs.  Otherwise, -1 is returned and</span>
<a name="587" /><span class="True">     587:</span> <span class="k">      an exception set.</span>
<a name="588" /><span class="True">     588:</span> <span class="k">       */</span>
<a name="589" /><span class="True">     589:</span> 
<a name="590" /><span class="True">     590:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">PyObject_AsWriteBuffer</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">obj</span><span class="f">,</span>
<a name="591" /><span class="True">     591:</span>                                             <span class="m">void</span> <span class="f">*</span><span class="f">*</span><span class="b">buffer</span><span class="f">,</span>
<a name="592" /><span class="True">     592:</span>                                             <span class="b">Py_ssize_t</span> <span class="f">*</span><span class="b">buffer_len</span><span class="f">)</span><span class="f">;</span>
<a name="593" /><span class="True">     593:</span> 
<a name="594" /><span class="True">     594:</span>        <span class="k">/*</span>
<a name="595" /><span class="True">     595:</span> <span class="k">      Takes an arbitrary object which must support the (writable,</span>
<a name="596" /><span class="True">     596:</span> <span class="k">      single segment) buffer interface and returns a pointer to a</span>
<a name="597" /><span class="True">     597:</span> <span class="k">      writable memory location in buffer of size buffer_len.</span>
<a name="598" /><span class="True">     598:</span> <span class="k"></span>
<a name="599" /><span class="True">     599:</span> <span class="k">      0 is returned on success.  buffer and buffer_len are only</span>
<a name="600" /><span class="True">     600:</span> <span class="k">      set in case no error occurs. Otherwise, -1 is returned and</span>
<a name="601" /><span class="True">     601:</span> <span class="k">      an exception set.</span>
<a name="602" /><span class="True">     602:</span> <span class="k">       */</span>
<a name="603" /><span class="True">     603:</span> 
<a name="604" /><span class="True">     604:</span>     <span class="k">/* new buffer API */</span>
<a name="605" /><span class="True">     605:</span> 
<a name="606" /><span class="True">     606:</span> <span class="f">#</span><span class="n">ifndef</span> <span class="b">Py_LIMITED_API</span>
<a name="607" /><span class="True">     607:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlPYmplY3RfQ2hlY2tCdWZmZXJfMA__"><span class="b">PyObject_CheckBuffer</span></a><span class="f">(</span><span class="b">obj</span><span class="f">)</span> \
<a name="608" /><span class="True">     608:</span>     <span class="f">(</span><span class="f">(</span><span class="f">(</span><span class="b">obj</span><span class="f">)</span><span class="f">-&gt;</span><span class="b">ob_type</span><span class="f">-&gt;</span><span class="b">tp_as_buffer</span> <span class="f">!=</span> <a href="macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a><span class="f">)</span> <span class="f">&amp;&amp;</span>  \
<a name="609" /><span class="True">     609:</span>      <span class="f">(</span><span class="f">(</span><span class="b">obj</span><span class="f">)</span><span class="f">-&gt;</span><span class="b">ob_type</span><span class="f">-&gt;</span><span class="b">tp_as_buffer</span><span class="f">-&gt;</span><span class="b">bf_getbuffer</span> <span class="f">!=</span> <a href="macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a><span class="f">)</span><span class="f">)</span>
<a name="610" /><span class="True">     610:</span> 
<a name="611" /><span class="True">     611:</span>     <span class="k">/* Return 1 if the getbuffer function is available, otherwise</span>
<a name="612" /><span class="True">     612:</span> <span class="k">       return 0 */</span>
<a name="613" /><span class="True">     613:</span> 
<a name="614" /><span class="True">     614:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">PyObject_GetBuffer</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">obj</span><span class="f">,</span> <span class="b">Py_buffer</span> <span class="f">*</span><span class="b">view</span><span class="f">,</span>
<a name="615" /><span class="True">     615:</span>                                         <span class="m">int</span> <span class="b">flags</span><span class="f">)</span><span class="f">;</span>
<a name="616" /><span class="True">     616:</span> 
<a name="617" /><span class="True">     617:</span>     <span class="k">/* This is a C-API version of the getbuffer function call.  It checks</span>
<a name="618" /><span class="True">     618:</span> <span class="k">       to make sure object has the required function pointer and issues the</span>
<a name="619" /><span class="True">     619:</span> <span class="k">       call.  Returns -1 and raises an error on failure and returns 0 on</span>
<a name="620" /><span class="True">     620:</span> <span class="k">       success</span>
<a name="621" /><span class="True">     621:</span> <span class="k">    */</span>
<a name="622" /><span class="True">     622:</span> 
<a name="623" /><span class="True">     623:</span> 
<a name="624" /><span class="True">     624:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">void</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyBuffer_GetPointer</span><span class="f">(</span><span class="b">Py_buffer</span> <span class="f">*</span><span class="b">view</span><span class="f">,</span> <span class="b">Py_ssize_t</span> <span class="f">*</span><span class="b">indices</span><span class="f">)</span><span class="f">;</span>
<a name="625" /><span class="True">     625:</span> 
<a name="626" /><span class="True">     626:</span>     <span class="k">/* Get the memory area pointed to by the indices for the buffer given.</span>
<a name="627" /><span class="True">     627:</span> <span class="k">       Note that view-&gt;ndim is the assumed size of indices</span>
<a name="628" /><span class="True">     628:</span> <span class="k">    */</span>
<a name="629" /><span class="True">     629:</span> 
<a name="630" /><span class="True">     630:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">PyBuffer_SizeFromFormat</span><span class="f">(</span><span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="631" /><span class="True">     631:</span> 
<a name="632" /><span class="True">     632:</span>     <span class="k">/* Return the implied itemsize of the data-format area from a</span>
<a name="633" /><span class="True">     633:</span> <span class="k">       struct-style description */</span>
<a name="634" /><span class="True">     634:</span> 
<a name="635" /><span class="True">     635:</span> 
<a name="636" /><span class="True">     636:</span> 
<a name="637" /><span class="True">     637:</span>      <span class="k">/* Implementation in memoryobject.c */</span>
<a name="638" /><span class="True">     638:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">PyBuffer_ToContiguous</span><span class="f">(</span><span class="m">void</span> <span class="f">*</span><span class="b">buf</span><span class="f">,</span> <span class="b">Py_buffer</span> <span class="f">*</span><span class="b">view</span><span class="f">,</span>
<a name="639" /><span class="True">     639:</span>                                            <span class="b">Py_ssize_t</span> <span class="b">len</span><span class="f">,</span> <span class="m">char</span> <span class="b">order</span><span class="f">)</span><span class="f">;</span>
<a name="640" /><span class="True">     640:</span> 
<a name="641" /><span class="True">     641:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">PyBuffer_FromContiguous</span><span class="f">(</span><span class="b">Py_buffer</span> <span class="f">*</span><span class="b">view</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="b">buf</span><span class="f">,</span>
<a name="642" /><span class="True">     642:</span>                                              <span class="b">Py_ssize_t</span> <span class="b">len</span><span class="f">,</span> <span class="m">char</span> <span class="b">order</span><span class="f">)</span><span class="f">;</span>
<a name="643" /><span class="True">     643:</span> 
<a name="644" /><span class="True">     644:</span> 
<a name="645" /><span class="True">     645:</span>     <span class="k">/* Copy len bytes of data from the contiguous chunk of memory</span>
<a name="646" /><span class="True">     646:</span> <span class="k">       pointed to by buf into the buffer exported by obj.  Return</span>
<a name="647" /><span class="True">     647:</span> <span class="k">       0 on success and return -1 and raise a PyBuffer_Error on</span>
<a name="648" /><span class="True">     648:</span> <span class="k">       error (i.e. the object does not have a buffer interface or</span>
<a name="649" /><span class="True">     649:</span> <span class="k">       it is not working).</span>
<a name="650" /><span class="True">     650:</span> <span class="k"></span>
<a name="651" /><span class="True">     651:</span> <span class="k">       If fort is &apos;F&apos;, then if the object is multi-dimensional,</span>
<a name="652" /><span class="True">     652:</span> <span class="k">       then the data will be copied into the array in</span>
<a name="653" /><span class="True">     653:</span> <span class="k">       Fortran-style (first dimension varies the fastest).  If</span>
<a name="654" /><span class="True">     654:</span> <span class="k">       fort is &apos;C&apos;, then the data will be copied into the array</span>
<a name="655" /><span class="True">     655:</span> <span class="k">       in C-style (last dimension varies the fastest).  If fort</span>
<a name="656" /><span class="True">     656:</span> <span class="k">       is &apos;A&apos;, then it does not matter and the copy will be made</span>
<a name="657" /><span class="True">     657:</span> <span class="k">       in whatever way is more efficient.</span>
<a name="658" /><span class="True">     658:</span> <span class="k"></span>
<a name="659" /><span class="True">     659:</span> <span class="k">    */</span>
<a name="660" /><span class="True">     660:</span> 
<a name="661" /><span class="True">     661:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">PyObject_CopyData</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">dest</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">src</span><span class="f">)</span><span class="f">;</span>
<a name="662" /><span class="True">     662:</span> 
<a name="663" /><span class="True">     663:</span>     <span class="k">/* Copy the data from the src buffer to the buffer of destination</span>
<a name="664" /><span class="True">     664:</span> <span class="k">     */</span>
<a name="665" /><span class="True">     665:</span> 
<a name="666" /><span class="True">     666:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">PyBuffer_IsContiguous</span><span class="f">(</span><span class="m">const</span> <span class="b">Py_buffer</span> <span class="f">*</span><span class="b">view</span><span class="f">,</span> <span class="m">char</span> <span class="b">fort</span><span class="f">)</span><span class="f">;</span>
<a name="667" /><span class="True">     667:</span> 
<a name="668" /><span class="True">     668:</span> 
<a name="669" /><span class="True">     669:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">void</span><span class="f">)</span> <span class="b">PyBuffer_FillContiguousStrides</span><span class="f">(</span><span class="m">int</span> <span class="b">ndims</span><span class="f">,</span>
<a name="670" /><span class="True">     670:</span>                                                     <span class="b">Py_ssize_t</span> <span class="f">*</span><span class="b">shape</span><span class="f">,</span>
<a name="671" /><span class="True">     671:</span>                                                     <span class="b">Py_ssize_t</span> <span class="f">*</span><span class="b">strides</span><span class="f">,</span>
<a name="672" /><span class="True">     672:</span>                                                     <span class="m">int</span> <span class="b">itemsize</span><span class="f">,</span>
<a name="673" /><span class="True">     673:</span>                                                     <span class="m">char</span> <span class="b">fort</span><span class="f">)</span><span class="f">;</span>
<a name="674" /><span class="True">     674:</span> 
<a name="675" /><span class="True">     675:</span>     <span class="k">/*  Fill the strides array with byte-strides of a contiguous</span>
<a name="676" /><span class="True">     676:</span> <span class="k">        (Fortran-style if fort is &apos;F&apos; or C-style otherwise)</span>
<a name="677" /><span class="True">     677:</span> <span class="k">        array of the given shape with the given number of bytes</span>
<a name="678" /><span class="True">     678:</span> <span class="k">        per element.</span>
<a name="679" /><span class="True">     679:</span> <span class="k">    */</span>
<a name="680" /><span class="True">     680:</span> 
<a name="681" /><span class="True">     681:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">PyBuffer_FillInfo</span><span class="f">(</span><span class="b">Py_buffer</span> <span class="f">*</span><span class="b">view</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="b">buf</span><span class="f">,</span>
<a name="682" /><span class="True">     682:</span>                                        <span class="b">Py_ssize_t</span> <span class="b">len</span><span class="f">,</span> <span class="m">int</span> <span class="b">readonly</span><span class="f">,</span>
<a name="683" /><span class="True">     683:</span>                                        <span class="m">int</span> <span class="b">flags</span><span class="f">)</span><span class="f">;</span>
<a name="684" /><span class="True">     684:</span> 
<a name="685" /><span class="True">     685:</span>     <span class="k">/* Fills in a buffer-info structure correctly for an exporter</span>
<a name="686" /><span class="True">     686:</span> <span class="k">       that can only share a contiguous chunk of memory of</span>
<a name="687" /><span class="True">     687:</span> <span class="k">       &quot;unsigned bytes&quot; of the given length. Returns 0 on success</span>
<a name="688" /><span class="True">     688:</span> <span class="k">       and -1 (with raising an error) on error.</span>
<a name="689" /><span class="True">     689:</span> <span class="k">     */</span>
<a name="690" /><span class="True">     690:</span> 
<a name="691" /><span class="True">     691:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">void</span><span class="f">)</span> <span class="b">PyBuffer_Release</span><span class="f">(</span><span class="b">Py_buffer</span> <span class="f">*</span><span class="b">view</span><span class="f">)</span><span class="f">;</span>
<a name="692" /><span class="True">     692:</span> 
<a name="693" /><span class="True">     693:</span>        <span class="k">/* Releases a Py_buffer obtained from getbuffer ParseTuple&apos;s s*.</span>
<a name="694" /><span class="True">     694:</span> <span class="k">    */</span>
<a name="695" /><span class="True">     695:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* Py_LIMITED_API */</span>
<a name="696" /><span class="True">     696:</span> 
<a name="697" /><span class="True">     697:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyObject_Format</span><span class="f">(</span><span class="b">PyObject</span><span class="f">*</span> <span class="b">obj</span><span class="f">,</span>
<a name="698" /><span class="True">     698:</span>                                             <span class="b">PyObject</span> <span class="f">*</span><span class="b">format_spec</span><span class="f">)</span><span class="f">;</span>
<a name="699" /><span class="True">     699:</span>        <span class="k">/*</span>
<a name="700" /><span class="True">     700:</span> <span class="k">     Takes an arbitrary object and returns the result of</span>
<a name="701" /><span class="True">     701:</span> <span class="k">     calling obj.__format__(format_spec).</span>
<a name="702" /><span class="True">     702:</span> <span class="k">       */</span>
<a name="703" /><span class="True">     703:</span> 
<a name="704" /><span class="True">     704:</span> <span class="k">/* Iterators */</span>
<a name="705" /><span class="True">     705:</span> 
<a name="706" /><span class="True">     706:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyObject_GetIter</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="707" /><span class="True">     707:</span>      <span class="k">/* Takes an object and returns an iterator for it.</span>
<a name="708" /><span class="True">     708:</span> <span class="k">    This is typically a new iterator but if the argument</span>
<a name="709" /><span class="True">     709:</span> <span class="k">    is an iterator, this returns itself. */</span>
<a name="710" /><span class="True">     710:</span> 
<a name="711" /><span class="True">     711:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlJdGVyX0NoZWNrXzA_"><span class="b">PyIter_Check</span></a><span class="f">(</span><span class="b">obj</span><span class="f">)</span> \
<a name="712" /><span class="True">     712:</span>     <span class="f">(</span><span class="f">(</span><span class="b">obj</span><span class="f">)</span><span class="f">-&gt;</span><span class="b">ob_type</span><span class="f">-&gt;</span><span class="b">tp_iternext</span> <span class="f">!=</span> <a href="macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a> <span class="f">&amp;&amp;</span> \
<a name="713" /><span class="True">     713:</span>      <span class="f">(</span><span class="b">obj</span><span class="f">)</span><span class="f">-&gt;</span><span class="b">ob_type</span><span class="f">-&gt;</span><span class="b">tp_iternext</span> <span class="f">!=</span> <span class="f">&amp;</span><span class="b">_PyObject_NextNotImplemented</span><span class="f">)</span>
<a name="714" /><span class="True">     714:</span> 
<a name="715" /><span class="True">     715:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyIter_Next</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="716" /><span class="True">     716:</span>      <span class="k">/* Takes an iterator object and calls its tp_iternext slot,</span>
<a name="717" /><span class="True">     717:</span> <span class="k">    returning the next value.  If the iterator is exhausted,</span>
<a name="718" /><span class="True">     718:</span> <span class="k">    this returns NULL without setting an exception.</span>
<a name="719" /><span class="True">     719:</span> <span class="k">    NULL with an exception means an error occurred. */</span>
<a name="720" /><span class="True">     720:</span> 
<a name="721" /><span class="True">     721:</span> <span class="k">/*  Number Protocol:*/</span>
<a name="722" /><span class="True">     722:</span> 
<a name="723" /><span class="True">     723:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">PyNumber_Check</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">)</span><span class="f">;</span>
<a name="724" /><span class="True">     724:</span> 
<a name="725" /><span class="True">     725:</span>        <span class="k">/*</span>
<a name="726" /><span class="True">     726:</span> <span class="k">     Returns 1 if the object, o, provides numeric protocols, and</span>
<a name="727" /><span class="True">     727:</span> <span class="k">     false otherwise.</span>
<a name="728" /><span class="True">     728:</span> <span class="k"></span>
<a name="729" /><span class="True">     729:</span> <span class="k">     This function always succeeds.</span>
<a name="730" /><span class="True">     730:</span> <span class="k">       */</span>
<a name="731" /><span class="True">     731:</span> 
<a name="732" /><span class="True">     732:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyNumber_Add</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o1</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">o2</span><span class="f">)</span><span class="f">;</span>
<a name="733" /><span class="True">     733:</span> 
<a name="734" /><span class="True">     734:</span>        <span class="k">/*</span>
<a name="735" /><span class="True">     735:</span> <span class="k">     Returns the result of adding o1 and o2, or null on failure.</span>
<a name="736" /><span class="True">     736:</span> <span class="k">     This is the equivalent of the Python expression: o1+o2.</span>
<a name="737" /><span class="True">     737:</span> <span class="k">       */</span>
<a name="738" /><span class="True">     738:</span> 
<a name="739" /><span class="True">     739:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyNumber_Subtract</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o1</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">o2</span><span class="f">)</span><span class="f">;</span>
<a name="740" /><span class="True">     740:</span> 
<a name="741" /><span class="True">     741:</span>        <span class="k">/*</span>
<a name="742" /><span class="True">     742:</span> <span class="k">     Returns the result of subtracting o2 from o1, or null on</span>
<a name="743" /><span class="True">     743:</span> <span class="k">     failure.  This is the equivalent of the Python expression:</span>
<a name="744" /><span class="True">     744:</span> <span class="k">     o1-o2.</span>
<a name="745" /><span class="True">     745:</span> <span class="k">       */</span>
<a name="746" /><span class="True">     746:</span> 
<a name="747" /><span class="True">     747:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyNumber_Multiply</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o1</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">o2</span><span class="f">)</span><span class="f">;</span>
<a name="748" /><span class="True">     748:</span> 
<a name="749" /><span class="True">     749:</span>        <span class="k">/*</span>
<a name="750" /><span class="True">     750:</span> <span class="k">     Returns the result of multiplying o1 and o2, or null on</span>
<a name="751" /><span class="True">     751:</span> <span class="k">     failure.  This is the equivalent of the Python expression:</span>
<a name="752" /><span class="True">     752:</span> <span class="k">     o1*o2.</span>
<a name="753" /><span class="True">     753:</span> <span class="k">       */</span>
<a name="754" /><span class="True">     754:</span> 
<a name="755" /><span class="True">     755:</span> <span class="f">#</span><span class="n">if</span> <span class="f">!</span><span class="b">defined</span><span class="f">(</span><span class="b">Py_LIMITED_API</span><span class="f">)</span> <span class="f">||</span> <span class="b">Py_LIMITED_API</span><span class="f">+</span><span class="c">0</span> <span class="f">&gt;=</span> <span class="c">0x03050000</span>
<a name="756" /><span class="True">     756:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyNumber_MatrixMultiply</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o1</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">o2</span><span class="f">)</span><span class="f">;</span>
<a name="757" /><span class="True">     757:</span> 
<a name="758" /><span class="True">     758:</span>        <span class="k">/*</span>
<a name="759" /><span class="True">     759:</span> <span class="k">     This is the equivalent of the Python expression: o1 @ o2.</span>
<a name="760" /><span class="True">     760:</span> <span class="k">       */</span>
<a name="761" /><span class="True">     761:</span> <span class="f">#</span><span class="n">endif</span>
<a name="762" /><span class="True">     762:</span> 
<a name="763" /><span class="True">     763:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyNumber_FloorDivide</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o1</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">o2</span><span class="f">)</span><span class="f">;</span>
<a name="764" /><span class="True">     764:</span> 
<a name="765" /><span class="True">     765:</span>        <span class="k">/*</span>
<a name="766" /><span class="True">     766:</span> <span class="k">     Returns the result of dividing o1 by o2 giving an integral result,</span>
<a name="767" /><span class="True">     767:</span> <span class="k">     or null on failure.</span>
<a name="768" /><span class="True">     768:</span> <span class="k">     This is the equivalent of the Python expression: o1//o2.</span>
<a name="769" /><span class="True">     769:</span> <span class="k">       */</span>
<a name="770" /><span class="True">     770:</span> 
<a name="771" /><span class="True">     771:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyNumber_TrueDivide</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o1</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">o2</span><span class="f">)</span><span class="f">;</span>
<a name="772" /><span class="True">     772:</span> 
<a name="773" /><span class="True">     773:</span>        <span class="k">/*</span>
<a name="774" /><span class="True">     774:</span> <span class="k">     Returns the result of dividing o1 by o2 giving a float result,</span>
<a name="775" /><span class="True">     775:</span> <span class="k">     or null on failure.</span>
<a name="776" /><span class="True">     776:</span> <span class="k">     This is the equivalent of the Python expression: o1/o2.</span>
<a name="777" /><span class="True">     777:</span> <span class="k">       */</span>
<a name="778" /><span class="True">     778:</span> 
<a name="779" /><span class="True">     779:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyNumber_Remainder</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o1</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">o2</span><span class="f">)</span><span class="f">;</span>
<a name="780" /><span class="True">     780:</span> 
<a name="781" /><span class="True">     781:</span>        <span class="k">/*</span>
<a name="782" /><span class="True">     782:</span> <span class="k">     Returns the remainder of dividing o1 by o2, or null on</span>
<a name="783" /><span class="True">     783:</span> <span class="k">     failure.  This is the equivalent of the Python expression:</span>
<a name="784" /><span class="True">     784:</span> <span class="k">     o1%o2.</span>
<a name="785" /><span class="True">     785:</span> <span class="k">       */</span>
<a name="786" /><span class="True">     786:</span> 
<a name="787" /><span class="True">     787:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyNumber_Divmod</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o1</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">o2</span><span class="f">)</span><span class="f">;</span>
<a name="788" /><span class="True">     788:</span> 
<a name="789" /><span class="True">     789:</span>        <span class="k">/*</span>
<a name="790" /><span class="True">     790:</span> <span class="k">     See the built-in function divmod.  Returns NULL on failure.</span>
<a name="791" /><span class="True">     791:</span> <span class="k">     This is the equivalent of the Python expression:</span>
<a name="792" /><span class="True">     792:</span> <span class="k">     divmod(o1,o2).</span>
<a name="793" /><span class="True">     793:</span> <span class="k">       */</span>
<a name="794" /><span class="True">     794:</span> 
<a name="795" /><span class="True">     795:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyNumber_Power</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o1</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">o2</span><span class="f">,</span>
<a name="796" /><span class="True">     796:</span>                                            <span class="b">PyObject</span> <span class="f">*</span><span class="b">o3</span><span class="f">)</span><span class="f">;</span>
<a name="797" /><span class="True">     797:</span> 
<a name="798" /><span class="True">     798:</span>        <span class="k">/*</span>
<a name="799" /><span class="True">     799:</span> <span class="k">     See the built-in function pow.  Returns NULL on failure.</span>
<a name="800" /><span class="True">     800:</span> <span class="k">     This is the equivalent of the Python expression:</span>
<a name="801" /><span class="True">     801:</span> <span class="k">     pow(o1,o2,o3), where o3 is optional.</span>
<a name="802" /><span class="True">     802:</span> <span class="k">       */</span>
<a name="803" /><span class="True">     803:</span> 
<a name="804" /><span class="True">     804:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyNumber_Negative</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">)</span><span class="f">;</span>
<a name="805" /><span class="True">     805:</span> 
<a name="806" /><span class="True">     806:</span>        <span class="k">/*</span>
<a name="807" /><span class="True">     807:</span> <span class="k">     Returns the negation of o on success, or null on failure.</span>
<a name="808" /><span class="True">     808:</span> <span class="k">     This is the equivalent of the Python expression: -o.</span>
<a name="809" /><span class="True">     809:</span> <span class="k">       */</span>
<a name="810" /><span class="True">     810:</span> 
<a name="811" /><span class="True">     811:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyNumber_Positive</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">)</span><span class="f">;</span>
<a name="812" /><span class="True">     812:</span> 
<a name="813" /><span class="True">     813:</span>        <span class="k">/*</span>
<a name="814" /><span class="True">     814:</span> <span class="k">     Returns the (what?) of o on success, or NULL on failure.</span>
<a name="815" /><span class="True">     815:</span> <span class="k">     This is the equivalent of the Python expression: +o.</span>
<a name="816" /><span class="True">     816:</span> <span class="k">       */</span>
<a name="817" /><span class="True">     817:</span> 
<a name="818" /><span class="True">     818:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyNumber_Absolute</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">)</span><span class="f">;</span>
<a name="819" /><span class="True">     819:</span> 
<a name="820" /><span class="True">     820:</span>        <span class="k">/*</span>
<a name="821" /><span class="True">     821:</span> <span class="k">     Returns the absolute value of o, or null on failure.  This is</span>
<a name="822" /><span class="True">     822:</span> <span class="k">     the equivalent of the Python expression: abs(o).</span>
<a name="823" /><span class="True">     823:</span> <span class="k">       */</span>
<a name="824" /><span class="True">     824:</span> 
<a name="825" /><span class="True">     825:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyNumber_Invert</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">)</span><span class="f">;</span>
<a name="826" /><span class="True">     826:</span> 
<a name="827" /><span class="True">     827:</span>        <span class="k">/*</span>
<a name="828" /><span class="True">     828:</span> <span class="k">     Returns the bitwise negation of o on success, or NULL on</span>
<a name="829" /><span class="True">     829:</span> <span class="k">     failure.  This is the equivalent of the Python expression:</span>
<a name="830" /><span class="True">     830:</span> <span class="k">     ~o.</span>
<a name="831" /><span class="True">     831:</span> <span class="k">       */</span>
<a name="832" /><span class="True">     832:</span> 
<a name="833" /><span class="True">     833:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyNumber_Lshift</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o1</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">o2</span><span class="f">)</span><span class="f">;</span>
<a name="834" /><span class="True">     834:</span> 
<a name="835" /><span class="True">     835:</span>        <span class="k">/*</span>
<a name="836" /><span class="True">     836:</span> <span class="k">     Returns the result of left shifting o1 by o2 on success, or</span>
<a name="837" /><span class="True">     837:</span> <span class="k">     NULL on failure.  This is the equivalent of the Python</span>
<a name="838" /><span class="True">     838:</span> <span class="k">     expression: o1 &lt;&lt; o2.</span>
<a name="839" /><span class="True">     839:</span> <span class="k">       */</span>
<a name="840" /><span class="True">     840:</span> 
<a name="841" /><span class="True">     841:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyNumber_Rshift</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o1</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">o2</span><span class="f">)</span><span class="f">;</span>
<a name="842" /><span class="True">     842:</span> 
<a name="843" /><span class="True">     843:</span>        <span class="k">/*</span>
<a name="844" /><span class="True">     844:</span> <span class="k">     Returns the result of right shifting o1 by o2 on success, or</span>
<a name="845" /><span class="True">     845:</span> <span class="k">     NULL on failure.  This is the equivalent of the Python</span>
<a name="846" /><span class="True">     846:</span> <span class="k">     expression: o1 &gt;&gt; o2.</span>
<a name="847" /><span class="True">     847:</span> <span class="k">       */</span>
<a name="848" /><span class="True">     848:</span> 
<a name="849" /><span class="True">     849:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyNumber_And</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o1</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">o2</span><span class="f">)</span><span class="f">;</span>
<a name="850" /><span class="True">     850:</span> 
<a name="851" /><span class="True">     851:</span>        <span class="k">/*</span>
<a name="852" /><span class="True">     852:</span> <span class="k">     Returns the result of bitwise and of o1 and o2 on success, or</span>
<a name="853" /><span class="True">     853:</span> <span class="k">     NULL on failure. This is the equivalent of the Python</span>
<a name="854" /><span class="True">     854:</span> <span class="k">     expression: o1&amp;o2.</span>
<a name="855" /><span class="True">     855:</span> <span class="k"></span>
<a name="856" /><span class="True">     856:</span> <span class="k">       */</span>
<a name="857" /><span class="True">     857:</span> 
<a name="858" /><span class="True">     858:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyNumber_Xor</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o1</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">o2</span><span class="f">)</span><span class="f">;</span>
<a name="859" /><span class="True">     859:</span> 
<a name="860" /><span class="True">     860:</span>        <span class="k">/*</span>
<a name="861" /><span class="True">     861:</span> <span class="k">     Returns the bitwise exclusive or of o1 by o2 on success, or</span>
<a name="862" /><span class="True">     862:</span> <span class="k">     NULL on failure.  This is the equivalent of the Python</span>
<a name="863" /><span class="True">     863:</span> <span class="k">     expression: o1^o2.</span>
<a name="864" /><span class="True">     864:</span> <span class="k">       */</span>
<a name="865" /><span class="True">     865:</span> 
<a name="866" /><span class="True">     866:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyNumber_Or</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o1</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">o2</span><span class="f">)</span><span class="f">;</span>
<a name="867" /><span class="True">     867:</span> 
<a name="868" /><span class="True">     868:</span>        <span class="k">/*</span>
<a name="869" /><span class="True">     869:</span> <span class="k">     Returns the result of bitwise or on o1 and o2 on success, or</span>
<a name="870" /><span class="True">     870:</span> <span class="k">     NULL on failure.  This is the equivalent of the Python</span>
<a name="871" /><span class="True">     871:</span> <span class="k">     expression: o1|o2.</span>
<a name="872" /><span class="True">     872:</span> <span class="k">       */</span>
<a name="873" /><span class="True">     873:</span> 
<a name="874" /><span class="True">     874:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlJbmRleF9DaGVja18w"><span class="b">PyIndex_Check</span></a><span class="f">(</span><span class="b">obj</span><span class="f">)</span> \
<a name="875" /><span class="True">     875:</span>    <span class="f">(</span><span class="f">(</span><span class="b">obj</span><span class="f">)</span><span class="f">-&gt;</span><span class="b">ob_type</span><span class="f">-&gt;</span><span class="b">tp_as_number</span> <span class="f">!=</span> <a href="macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a> <span class="f">&amp;&amp;</span> \
<a name="876" /><span class="True">     876:</span>     <span class="f">(</span><span class="b">obj</span><span class="f">)</span><span class="f">-&gt;</span><span class="b">ob_type</span><span class="f">-&gt;</span><span class="b">tp_as_number</span><span class="f">-&gt;</span><span class="b">nb_index</span> <span class="f">!=</span> <a href="macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a><span class="f">)</span>
<a name="877" /><span class="True">     877:</span> 
<a name="878" /><span class="True">     878:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyNumber_Index</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">)</span><span class="f">;</span>
<a name="879" /><span class="True">     879:</span> 
<a name="880" /><span class="True">     880:</span>        <span class="k">/*</span>
<a name="881" /><span class="True">     881:</span> <span class="k">     Returns the object converted to a Python int</span>
<a name="882" /><span class="True">     882:</span> <span class="k">     or NULL with an error raised on failure.</span>
<a name="883" /><span class="True">     883:</span> <span class="k">       */</span>
<a name="884" /><span class="True">     884:</span> 
<a name="885" /><span class="True">     885:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">Py_ssize_t</span><span class="f">)</span> <span class="b">PyNumber_AsSsize_t</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">exc</span><span class="f">)</span><span class="f">;</span>
<a name="886" /><span class="True">     886:</span> 
<a name="887" /><span class="True">     887:</span>        <span class="k">/*</span>
<a name="888" /><span class="True">     888:</span> <span class="k">    Returns the object converted to Py_ssize_t by going through</span>
<a name="889" /><span class="True">     889:</span> <span class="k">    PyNumber_Index first.  If an overflow error occurs while</span>
<a name="890" /><span class="True">     890:</span> <span class="k">    converting the int to Py_ssize_t, then the second argument</span>
<a name="891" /><span class="True">     891:</span> <span class="k">    is the error-type to return.  If it is NULL, then the overflow error</span>
<a name="892" /><span class="True">     892:</span> <span class="k">    is cleared and the value is clipped.</span>
<a name="893" /><span class="True">     893:</span> <span class="k">       */</span>
<a name="894" /><span class="True">     894:</span> 
<a name="895" /><span class="True">     895:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyNumber_Long</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">)</span><span class="f">;</span>
<a name="896" /><span class="True">     896:</span> 
<a name="897" /><span class="True">     897:</span>        <span class="k">/*</span>
<a name="898" /><span class="True">     898:</span> <span class="k">     Returns the o converted to an integer object on success, or</span>
<a name="899" /><span class="True">     899:</span> <span class="k">     NULL on failure.  This is the equivalent of the Python</span>
<a name="900" /><span class="True">     900:</span> <span class="k">     expression: int(o).</span>
<a name="901" /><span class="True">     901:</span> <span class="k">       */</span>
<a name="902" /><span class="True">     902:</span> 
<a name="903" /><span class="True">     903:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyNumber_Float</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">)</span><span class="f">;</span>
<a name="904" /><span class="True">     904:</span> 
<a name="905" /><span class="True">     905:</span>        <span class="k">/*</span>
<a name="906" /><span class="True">     906:</span> <span class="k">     Returns the o converted to a float object on success, or NULL</span>
<a name="907" /><span class="True">     907:</span> <span class="k">     on failure.  This is the equivalent of the Python expression:</span>
<a name="908" /><span class="True">     908:</span> <span class="k">     float(o).</span>
<a name="909" /><span class="True">     909:</span> <span class="k">       */</span>
<a name="910" /><span class="True">     910:</span> 
<a name="911" /><span class="True">     911:</span> <span class="k">/*  In-place variants of (some of) the above number protocol functions */</span>
<a name="912" /><span class="True">     912:</span> 
<a name="913" /><span class="True">     913:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyNumber_InPlaceAdd</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o1</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">o2</span><span class="f">)</span><span class="f">;</span>
<a name="914" /><span class="True">     914:</span> 
<a name="915" /><span class="True">     915:</span>        <span class="k">/*</span>
<a name="916" /><span class="True">     916:</span> <span class="k">     Returns the result of adding o2 to o1, possibly in-place, or null</span>
<a name="917" /><span class="True">     917:</span> <span class="k">     on failure.  This is the equivalent of the Python expression:</span>
<a name="918" /><span class="True">     918:</span> <span class="k">     o1 += o2.</span>
<a name="919" /><span class="True">     919:</span> <span class="k">       */</span>
<a name="920" /><span class="True">     920:</span> 
<a name="921" /><span class="True">     921:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyNumber_InPlaceSubtract</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o1</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">o2</span><span class="f">)</span><span class="f">;</span>
<a name="922" /><span class="True">     922:</span> 
<a name="923" /><span class="True">     923:</span>        <span class="k">/*</span>
<a name="924" /><span class="True">     924:</span> <span class="k">     Returns the result of subtracting o2 from o1, possibly in-place or</span>
<a name="925" /><span class="True">     925:</span> <span class="k">     null on failure.  This is the equivalent of the Python expression:</span>
<a name="926" /><span class="True">     926:</span> <span class="k">     o1 -= o2.</span>
<a name="927" /><span class="True">     927:</span> <span class="k">       */</span>
<a name="928" /><span class="True">     928:</span> 
<a name="929" /><span class="True">     929:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyNumber_InPlaceMultiply</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o1</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">o2</span><span class="f">)</span><span class="f">;</span>
<a name="930" /><span class="True">     930:</span> 
<a name="931" /><span class="True">     931:</span>        <span class="k">/*</span>
<a name="932" /><span class="True">     932:</span> <span class="k">     Returns the result of multiplying o1 by o2, possibly in-place, or</span>
<a name="933" /><span class="True">     933:</span> <span class="k">     null on failure.  This is the equivalent of the Python expression:</span>
<a name="934" /><span class="True">     934:</span> <span class="k">     o1 *= o2.</span>
<a name="935" /><span class="True">     935:</span> <span class="k">       */</span>
<a name="936" /><span class="True">     936:</span> 
<a name="937" /><span class="True">     937:</span> <span class="f">#</span><span class="n">if</span> <span class="f">!</span><span class="b">defined</span><span class="f">(</span><span class="b">Py_LIMITED_API</span><span class="f">)</span> <span class="f">||</span> <span class="b">Py_LIMITED_API</span><span class="f">+</span><span class="c">0</span> <span class="f">&gt;=</span> <span class="c">0x03050000</span>
<a name="938" /><span class="True">     938:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyNumber_InPlaceMatrixMultiply</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o1</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">o2</span><span class="f">)</span><span class="f">;</span>
<a name="939" /><span class="True">     939:</span> 
<a name="940" /><span class="True">     940:</span>        <span class="k">/*</span>
<a name="941" /><span class="True">     941:</span> <span class="k">     This is the equivalent of the Python expression: o1 @= o2.</span>
<a name="942" /><span class="True">     942:</span> <span class="k">       */</span>
<a name="943" /><span class="True">     943:</span> <span class="f">#</span><span class="n">endif</span>
<a name="944" /><span class="True">     944:</span> 
<a name="945" /><span class="True">     945:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyNumber_InPlaceFloorDivide</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o1</span><span class="f">,</span>
<a name="946" /><span class="True">     946:</span>                                                         <span class="b">PyObject</span> <span class="f">*</span><span class="b">o2</span><span class="f">)</span><span class="f">;</span>
<a name="947" /><span class="True">     947:</span> 
<a name="948" /><span class="True">     948:</span>        <span class="k">/*</span>
<a name="949" /><span class="True">     949:</span> <span class="k">     Returns the result of dividing o1 by o2 giving an integral result,</span>
<a name="950" /><span class="True">     950:</span> <span class="k">     possibly in-place, or null on failure.</span>
<a name="951" /><span class="True">     951:</span> <span class="k">     This is the equivalent of the Python expression:</span>
<a name="952" /><span class="True">     952:</span> <span class="k">     o1 /= o2.</span>
<a name="953" /><span class="True">     953:</span> <span class="k">       */</span>
<a name="954" /><span class="True">     954:</span> 
<a name="955" /><span class="True">     955:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyNumber_InPlaceTrueDivide</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o1</span><span class="f">,</span>
<a name="956" /><span class="True">     956:</span>                                                        <span class="b">PyObject</span> <span class="f">*</span><span class="b">o2</span><span class="f">)</span><span class="f">;</span>
<a name="957" /><span class="True">     957:</span> 
<a name="958" /><span class="True">     958:</span>        <span class="k">/*</span>
<a name="959" /><span class="True">     959:</span> <span class="k">     Returns the result of dividing o1 by o2 giving a float result,</span>
<a name="960" /><span class="True">     960:</span> <span class="k">     possibly in-place, or null on failure.</span>
<a name="961" /><span class="True">     961:</span> <span class="k">     This is the equivalent of the Python expression:</span>
<a name="962" /><span class="True">     962:</span> <span class="k">     o1 /= o2.</span>
<a name="963" /><span class="True">     963:</span> <span class="k">       */</span>
<a name="964" /><span class="True">     964:</span> 
<a name="965" /><span class="True">     965:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyNumber_InPlaceRemainder</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o1</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">o2</span><span class="f">)</span><span class="f">;</span>
<a name="966" /><span class="True">     966:</span> 
<a name="967" /><span class="True">     967:</span>        <span class="k">/*</span>
<a name="968" /><span class="True">     968:</span> <span class="k">     Returns the remainder of dividing o1 by o2, possibly in-place, or</span>
<a name="969" /><span class="True">     969:</span> <span class="k">     null on failure.  This is the equivalent of the Python expression:</span>
<a name="970" /><span class="True">     970:</span> <span class="k">     o1 %= o2.</span>
<a name="971" /><span class="True">     971:</span> <span class="k">       */</span>
<a name="972" /><span class="True">     972:</span> 
<a name="973" /><span class="True">     973:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyNumber_InPlacePower</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o1</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">o2</span><span class="f">,</span>
<a name="974" /><span class="True">     974:</span>                                                   <span class="b">PyObject</span> <span class="f">*</span><span class="b">o3</span><span class="f">)</span><span class="f">;</span>
<a name="975" /><span class="True">     975:</span> 
<a name="976" /><span class="True">     976:</span>        <span class="k">/*</span>
<a name="977" /><span class="True">     977:</span> <span class="k">     Returns the result of raising o1 to the power of o2, possibly</span>
<a name="978" /><span class="True">     978:</span> <span class="k">     in-place, or null on failure.  This is the equivalent of the Python</span>
<a name="979" /><span class="True">     979:</span> <span class="k">     expression: o1 **= o2, or pow(o1, o2, o3) if o3 is present.</span>
<a name="980" /><span class="True">     980:</span> <span class="k">       */</span>
<a name="981" /><span class="True">     981:</span> 
<a name="982" /><span class="True">     982:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyNumber_InPlaceLshift</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o1</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">o2</span><span class="f">)</span><span class="f">;</span>
<a name="983" /><span class="True">     983:</span> 
<a name="984" /><span class="True">     984:</span>        <span class="k">/*</span>
<a name="985" /><span class="True">     985:</span> <span class="k">     Returns the result of left shifting o1 by o2, possibly in-place, or</span>
<a name="986" /><span class="True">     986:</span> <span class="k">     null on failure.  This is the equivalent of the Python expression:</span>
<a name="987" /><span class="True">     987:</span> <span class="k">     o1 &lt;&lt;= o2.</span>
<a name="988" /><span class="True">     988:</span> <span class="k">       */</span>
<a name="989" /><span class="True">     989:</span> 
<a name="990" /><span class="True">     990:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyNumber_InPlaceRshift</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o1</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">o2</span><span class="f">)</span><span class="f">;</span>
<a name="991" /><span class="True">     991:</span> 
<a name="992" /><span class="True">     992:</span>        <span class="k">/*</span>
<a name="993" /><span class="True">     993:</span> <span class="k">     Returns the result of right shifting o1 by o2, possibly in-place or</span>
<a name="994" /><span class="True">     994:</span> <span class="k">     null on failure.  This is the equivalent of the Python expression:</span>
<a name="995" /><span class="True">     995:</span> <span class="k">     o1 &gt;&gt;= o2.</span>
<a name="996" /><span class="True">     996:</span> <span class="k">       */</span>
<a name="997" /><span class="True">     997:</span> 
<a name="998" /><span class="True">     998:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyNumber_InPlaceAnd</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o1</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">o2</span><span class="f">)</span><span class="f">;</span>
<a name="999" /><span class="True">     999:</span> 
<a name="1000" /><span class="True">    1000:</span>        <span class="k">/*</span>
<a name="1001" /><span class="True">    1001:</span> <span class="k">     Returns the result of bitwise and of o1 and o2, possibly in-place,</span>
<a name="1002" /><span class="True">    1002:</span> <span class="k">     or null on failure. This is the equivalent of the Python</span>
<a name="1003" /><span class="True">    1003:</span> <span class="k">     expression: o1 &amp;= o2.</span>
<a name="1004" /><span class="True">    1004:</span> <span class="k">       */</span>
<a name="1005" /><span class="True">    1005:</span> 
<a name="1006" /><span class="True">    1006:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyNumber_InPlaceXor</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o1</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">o2</span><span class="f">)</span><span class="f">;</span>
<a name="1007" /><span class="True">    1007:</span> 
<a name="1008" /><span class="True">    1008:</span>        <span class="k">/*</span>
<a name="1009" /><span class="True">    1009:</span> <span class="k">     Returns the bitwise exclusive or of o1 by o2, possibly in-place, or</span>
<a name="1010" /><span class="True">    1010:</span> <span class="k">     null on failure.  This is the equivalent of the Python expression:</span>
<a name="1011" /><span class="True">    1011:</span> <span class="k">     o1 ^= o2.</span>
<a name="1012" /><span class="True">    1012:</span> <span class="k">       */</span>
<a name="1013" /><span class="True">    1013:</span> 
<a name="1014" /><span class="True">    1014:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyNumber_InPlaceOr</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o1</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">o2</span><span class="f">)</span><span class="f">;</span>
<a name="1015" /><span class="True">    1015:</span> 
<a name="1016" /><span class="True">    1016:</span>        <span class="k">/*</span>
<a name="1017" /><span class="True">    1017:</span> <span class="k">     Returns the result of bitwise or of o1 and o2, possibly in-place,</span>
<a name="1018" /><span class="True">    1018:</span> <span class="k">     or null on failure.  This is the equivalent of the Python</span>
<a name="1019" /><span class="True">    1019:</span> <span class="k">     expression: o1 |= o2.</span>
<a name="1020" /><span class="True">    1020:</span> <span class="k">       */</span>
<a name="1021" /><span class="True">    1021:</span> 
<a name="1022" /><span class="True">    1022:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyNumber_ToBase</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">n</span><span class="f">,</span> <span class="m">int</span> <span class="b">base</span><span class="f">)</span><span class="f">;</span>
<a name="1023" /><span class="True">    1023:</span> 
<a name="1024" /><span class="True">    1024:</span>        <span class="k">/*</span>
<a name="1025" /><span class="True">    1025:</span> <span class="k">     Returns the integer n converted to a string with a base, with a base</span>
<a name="1026" /><span class="True">    1026:</span> <span class="k">     marker of 0b, 0o or 0x prefixed if applicable.</span>
<a name="1027" /><span class="True">    1027:</span> <span class="k">     If n is not an int object, it is converted with PyNumber_Index first.</span>
<a name="1028" /><span class="True">    1028:</span> <span class="k">       */</span>
<a name="1029" /><span class="True">    1029:</span> 
<a name="1030" /><span class="True">    1030:</span> 
<a name="1031" /><span class="True">    1031:</span> <span class="k">/*  Sequence protocol:*/</span>
<a name="1032" /><span class="True">    1032:</span> 
<a name="1033" /><span class="True">    1033:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">PySequence_Check</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">)</span><span class="f">;</span>
<a name="1034" /><span class="True">    1034:</span> 
<a name="1035" /><span class="True">    1035:</span>        <span class="k">/*</span>
<a name="1036" /><span class="True">    1036:</span> <span class="k">     Return 1 if the object provides sequence protocol, and zero</span>
<a name="1037" /><span class="True">    1037:</span> <span class="k">     otherwise.</span>
<a name="1038" /><span class="True">    1038:</span> <span class="k"></span>
<a name="1039" /><span class="True">    1039:</span> <span class="k">     This function always succeeds.</span>
<a name="1040" /><span class="True">    1040:</span> <span class="k">       */</span>
<a name="1041" /><span class="True">    1041:</span> 
<a name="1042" /><span class="True">    1042:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">Py_ssize_t</span><span class="f">)</span> <span class="b">PySequence_Size</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">)</span><span class="f">;</span>
<a name="1043" /><span class="True">    1043:</span> 
<a name="1044" /><span class="True">    1044:</span>        <span class="k">/*</span>
<a name="1045" /><span class="True">    1045:</span> <span class="k">     Return the size of sequence object o, or -1 on failure.</span>
<a name="1046" /><span class="True">    1046:</span> <span class="k">       */</span>
<a name="1047" /><span class="True">    1047:</span> 
<a name="1048" /><span class="True">    1048:</span>        <span class="k">/* For DLL compatibility */</span>
<a name="1049" /><span class="True">    1049:</span> <span class="f">#</span><span class="n">undef</span> <a href="macros_noref.html#_UHlTZXF1ZW5jZV9MZW5ndGhfMA__"><span class="b">PySequence_Length</span></a>
<a name="1050" /><span class="True">    1050:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">Py_ssize_t</span><span class="f">)</span> <a href="macros_noref.html#_UHlTZXF1ZW5jZV9MZW5ndGhfMA__"><span class="b">PySequence_Length</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">)</span><span class="f">;</span>
<a name="1051" /><span class="True">    1051:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlTZXF1ZW5jZV9MZW5ndGhfMA__"><span class="b">PySequence_Length</span></a> <span class="b">PySequence_Size</span>
<a name="1052" /><span class="True">    1052:</span> 
<a name="1053" /><span class="True">    1053:</span> 
<a name="1054" /><span class="True">    1054:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PySequence_Concat</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o1</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">o2</span><span class="f">)</span><span class="f">;</span>
<a name="1055" /><span class="True">    1055:</span> 
<a name="1056" /><span class="True">    1056:</span>        <span class="k">/*</span>
<a name="1057" /><span class="True">    1057:</span> <span class="k">     Return the concatenation of o1 and o2 on success, and NULL on</span>
<a name="1058" /><span class="True">    1058:</span> <span class="k">     failure.   This is the equivalent of the Python</span>
<a name="1059" /><span class="True">    1059:</span> <span class="k">     expression: o1+o2.</span>
<a name="1060" /><span class="True">    1060:</span> <span class="k">       */</span>
<a name="1061" /><span class="True">    1061:</span> 
<a name="1062" /><span class="True">    1062:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PySequence_Repeat</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">,</span> <span class="b">Py_ssize_t</span> <span class="b">count</span><span class="f">)</span><span class="f">;</span>
<a name="1063" /><span class="True">    1063:</span> 
<a name="1064" /><span class="True">    1064:</span>        <span class="k">/*</span>
<a name="1065" /><span class="True">    1065:</span> <span class="k">     Return the result of repeating sequence object o count times,</span>
<a name="1066" /><span class="True">    1066:</span> <span class="k">     or NULL on failure.  This is the equivalent of the Python</span>
<a name="1067" /><span class="True">    1067:</span> <span class="k">     expression: o1*count.</span>
<a name="1068" /><span class="True">    1068:</span> <span class="k">       */</span>
<a name="1069" /><span class="True">    1069:</span> 
<a name="1070" /><span class="True">    1070:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PySequence_GetItem</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">,</span> <span class="b">Py_ssize_t</span> <span class="b">i</span><span class="f">)</span><span class="f">;</span>
<a name="1071" /><span class="True">    1071:</span> 
<a name="1072" /><span class="True">    1072:</span>        <span class="k">/*</span>
<a name="1073" /><span class="True">    1073:</span> <span class="k">     Return the ith element of o, or NULL on failure. This is the</span>
<a name="1074" /><span class="True">    1074:</span> <span class="k">     equivalent of the Python expression: o[i].</span>
<a name="1075" /><span class="True">    1075:</span> <span class="k">       */</span>
<a name="1076" /><span class="True">    1076:</span> 
<a name="1077" /><span class="True">    1077:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PySequence_GetSlice</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">,</span> <span class="b">Py_ssize_t</span> <span class="b">i1</span><span class="f">,</span> <span class="b">Py_ssize_t</span> <span class="b">i2</span><span class="f">)</span><span class="f">;</span>
<a name="1078" /><span class="True">    1078:</span> 
<a name="1079" /><span class="True">    1079:</span>        <span class="k">/*</span>
<a name="1080" /><span class="True">    1080:</span> <span class="k">     Return the slice of sequence object o between i1 and i2, or</span>
<a name="1081" /><span class="True">    1081:</span> <span class="k">     NULL on failure. This is the equivalent of the Python</span>
<a name="1082" /><span class="True">    1082:</span> <span class="k">     expression: o[i1:i2].</span>
<a name="1083" /><span class="True">    1083:</span> <span class="k">       */</span>
<a name="1084" /><span class="True">    1084:</span> 
<a name="1085" /><span class="True">    1085:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">PySequence_SetItem</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">,</span> <span class="b">Py_ssize_t</span> <span class="b">i</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">v</span><span class="f">)</span><span class="f">;</span>
<a name="1086" /><span class="True">    1086:</span> 
<a name="1087" /><span class="True">    1087:</span>        <span class="k">/*</span>
<a name="1088" /><span class="True">    1088:</span> <span class="k">     Assign object v to the ith element of o.  Raise an exception and return</span>
<a name="1089" /><span class="True">    1089:</span> <span class="k">     -1 on failure; return 0 on success.  This is the equivalent of the</span>
<a name="1090" /><span class="True">    1090:</span> <span class="k">     Python statement o[i]=v.</span>
<a name="1091" /><span class="True">    1091:</span> <span class="k">       */</span>
<a name="1092" /><span class="True">    1092:</span> 
<a name="1093" /><span class="True">    1093:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">PySequence_DelItem</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">,</span> <span class="b">Py_ssize_t</span> <span class="b">i</span><span class="f">)</span><span class="f">;</span>
<a name="1094" /><span class="True">    1094:</span> 
<a name="1095" /><span class="True">    1095:</span>        <span class="k">/*</span>
<a name="1096" /><span class="True">    1096:</span> <span class="k">     Delete the ith element of object v.  Returns</span>
<a name="1097" /><span class="True">    1097:</span> <span class="k">     -1 on failure.  This is the equivalent of the Python</span>
<a name="1098" /><span class="True">    1098:</span> <span class="k">     statement: del o[i].</span>
<a name="1099" /><span class="True">    1099:</span> <span class="k">       */</span>
<a name="1100" /><span class="True">    1100:</span> 
<a name="1101" /><span class="True">    1101:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">PySequence_SetSlice</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">,</span> <span class="b">Py_ssize_t</span> <span class="b">i1</span><span class="f">,</span> <span class="b">Py_ssize_t</span> <span class="b">i2</span><span class="f">,</span>
<a name="1102" /><span class="True">    1102:</span>                                          <span class="b">PyObject</span> <span class="f">*</span><span class="b">v</span><span class="f">)</span><span class="f">;</span>
<a name="1103" /><span class="True">    1103:</span> 
<a name="1104" /><span class="True">    1104:</span>        <span class="k">/*</span>
<a name="1105" /><span class="True">    1105:</span> <span class="k">     Assign the sequence object, v, to the slice in sequence</span>
<a name="1106" /><span class="True">    1106:</span> <span class="k">     object, o, from i1 to i2.  Returns -1 on failure. This is the</span>
<a name="1107" /><span class="True">    1107:</span> <span class="k">     equivalent of the Python statement: o[i1:i2]=v.</span>
<a name="1108" /><span class="True">    1108:</span> <span class="k">       */</span>
<a name="1109" /><span class="True">    1109:</span> 
<a name="1110" /><span class="True">    1110:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">PySequence_DelSlice</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">,</span> <span class="b">Py_ssize_t</span> <span class="b">i1</span><span class="f">,</span> <span class="b">Py_ssize_t</span> <span class="b">i2</span><span class="f">)</span><span class="f">;</span>
<a name="1111" /><span class="True">    1111:</span> 
<a name="1112" /><span class="True">    1112:</span>        <span class="k">/*</span>
<a name="1113" /><span class="True">    1113:</span> <span class="k">     Delete the slice in sequence object, o, from i1 to i2.</span>
<a name="1114" /><span class="True">    1114:</span> <span class="k">     Returns -1 on failure. This is the equivalent of the Python</span>
<a name="1115" /><span class="True">    1115:</span> <span class="k">     statement: del o[i1:i2].</span>
<a name="1116" /><span class="True">    1116:</span> <span class="k">       */</span>
<a name="1117" /><span class="True">    1117:</span> 
<a name="1118" /><span class="True">    1118:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PySequence_Tuple</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">)</span><span class="f">;</span>
<a name="1119" /><span class="True">    1119:</span> 
<a name="1120" /><span class="True">    1120:</span>        <span class="k">/*</span>
<a name="1121" /><span class="True">    1121:</span> <span class="k">     Returns the sequence, o, as a tuple on success, and NULL on failure.</span>
<a name="1122" /><span class="True">    1122:</span> <span class="k">     This is equivalent to the Python expression: tuple(o)</span>
<a name="1123" /><span class="True">    1123:</span> <span class="k">       */</span>
<a name="1124" /><span class="True">    1124:</span> 
<a name="1125" /><span class="True">    1125:</span> 
<a name="1126" /><span class="True">    1126:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PySequence_List</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">)</span><span class="f">;</span>
<a name="1127" /><span class="True">    1127:</span>        <span class="k">/*</span>
<a name="1128" /><span class="True">    1128:</span> <span class="k">     Returns the sequence, o, as a list on success, and NULL on failure.</span>
<a name="1129" /><span class="True">    1129:</span> <span class="k">     This is equivalent to the Python expression: list(o)</span>
<a name="1130" /><span class="True">    1130:</span> <span class="k">       */</span>
<a name="1131" /><span class="True">    1131:</span> 
<a name="1132" /><span class="True">    1132:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PySequence_Fast</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">,</span> <span class="m">const</span> <span class="m">char</span><span class="f">*</span> <span class="b">m</span><span class="f">)</span><span class="f">;</span>
<a name="1133" /><span class="True">    1133:</span>        <span class="k">/*</span>
<a name="1134" /><span class="True">    1134:</span> <span class="k">     Return the sequence, o, as a list, unless it&apos;s already a</span>
<a name="1135" /><span class="True">    1135:</span> <span class="k">     tuple or list.  Use PySequence_Fast_GET_ITEM to access the</span>
<a name="1136" /><span class="True">    1136:</span> <span class="k">     members of this list, and PySequence_Fast_GET_SIZE to get its length.</span>
<a name="1137" /><span class="True">    1137:</span> <span class="k"></span>
<a name="1138" /><span class="True">    1138:</span> <span class="k">     Returns NULL on failure.  If the object does not support iteration,</span>
<a name="1139" /><span class="True">    1139:</span> <span class="k">     raises a TypeError exception with m as the message text.</span>
<a name="1140" /><span class="True">    1140:</span> <span class="k">       */</span>
<a name="1141" /><span class="True">    1141:</span> 
<a name="1142" /><span class="True">    1142:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_ref.html#_UHlTZXF1ZW5jZV9GYXN0X0dFVF9TSVpFXzA_"><span class="b">PySequence_Fast_GET_SIZE</span></a><span class="f">(</span><span class="b">o</span><span class="f">)</span> \
<a name="1143" /><span class="True">    1143:</span>     <span class="f">(</span><a href="macros_ref.html#_UHlMaXN0X0NoZWNrXzA_"><span class="b">PyList_Check</span></a><span class="f">(</span><span class="b">o</span><span class="f">)</span> <span class="f">?</span> <a href="macros_ref.html#_UHlMaXN0X0dFVF9TSVpFXzA_"><span class="b">PyList_GET_SIZE</span></a><span class="f">(</span><span class="b">o</span><span class="f">)</span> <span class="f">:</span> <a href="macros_ref.html#_UHlUdXBsZV9HRVRfU0laRV8w"><span class="b">PyTuple_GET_SIZE</span></a><span class="f">(</span><span class="b">o</span><span class="f">)</span><span class="f">)</span>
<a name="1144" /><span class="True">    1144:</span>        <span class="k">/*</span>
<a name="1145" /><span class="True">    1145:</span> <span class="k">     Return the size of o, assuming that o was returned by</span>
<a name="1146" /><span class="True">    1146:</span> <span class="k">     PySequence_Fast and is not NULL.</span>
<a name="1147" /><span class="True">    1147:</span> <span class="k">       */</span>
<a name="1148" /><span class="True">    1148:</span> 
<a name="1149" /><span class="True">    1149:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_ref.html#_UHlTZXF1ZW5jZV9GYXN0X0dFVF9JVEVNXzA_"><span class="b">PySequence_Fast_GET_ITEM</span></a><span class="f">(</span><span class="b">o</span><span class="f">,</span> <span class="b">i</span><span class="f">)\
</span>     <span class="f">(</span><a href="macros_ref.html#_UHlMaXN0X0NoZWNrXzA_"><span class="b">PyList_Check</span></a><span class="f">(</span><span class="b">o</span><span class="f">)</span> <span class="f">?</span> <a href="macros_ref.html#_UHlMaXN0X0dFVF9JVEVNXzA_"><span class="b">PyList_GET_ITEM</span></a><span class="f">(</span><span class="b">o</span><span class="f">,</span> <span class="b">i</span><span class="f">)</span> <span class="f">:</span> <a href="macros_ref.html#_UHlUdXBsZV9HRVRfSVRFTV8w"><span class="b">PyTuple_GET_ITEM</span></a><span class="f">(</span><span class="b">o</span><span class="f">,</span> <span class="b">i</span><span class="f">)</span><span class="f">)</span>
<a name="1151" /><span class="True">    1151:</span>        <span class="k">/*</span>
<a name="1152" /><span class="True">    1152:</span> <span class="k">     Return the ith element of o, assuming that o was returned by</span>
<a name="1153" /><span class="True">    1153:</span> <span class="k">     PySequence_Fast, and that i is within bounds.</span>
<a name="1154" /><span class="True">    1154:</span> <span class="k">       */</span>
<a name="1155" /><span class="True">    1155:</span> 
<a name="1156" /><span class="True">    1156:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlTZXF1ZW5jZV9JVEVNXzA_"><span class="b">PySequence_ITEM</span></a><span class="f">(</span><span class="b">o</span><span class="f">,</span> <span class="b">i</span><span class="f">)\
</span>    <span class="f">(</span> <a href="macros_ref.html#_UHlfVFlQRV8w"><span class="b">Py_TYPE</span></a><span class="f">(</span><span class="b">o</span><span class="f">)</span><span class="f">-&gt;</span><span class="b">tp_as_sequence</span><span class="f">-&gt;</span><span class="b">sq_item</span><span class="f">(</span><span class="b">o</span><span class="f">,</span> <span class="b">i</span><span class="f">)</span> <span class="f">)</span>
<a name="1158" /><span class="True">    1158:</span>        <span class="k">/* Assume tp_as_sequence and sq_item exist and that i does not</span>
<a name="1159" /><span class="True">    1159:</span> <span class="k">      need to be corrected for a negative index</span>
<a name="1160" /><span class="True">    1160:</span> <span class="k">       */</span>
<a name="1161" /><span class="True">    1161:</span> 
<a name="1162" /><span class="True">    1162:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlTZXF1ZW5jZV9GYXN0X0lURU1TXzA_"><span class="b">PySequence_Fast_ITEMS</span></a><span class="f">(</span><span class="b">sf</span><span class="f">)</span> \
<a name="1163" /><span class="True">    1163:</span>     <span class="f">(</span><a href="macros_ref.html#_UHlMaXN0X0NoZWNrXzA_"><span class="b">PyList_Check</span></a><span class="f">(</span><span class="b">sf</span><span class="f">)</span> <span class="f">?</span> <span class="f">(</span><span class="f">(</span><span class="b">PyListObject</span> <span class="f">*</span><span class="f">)</span><span class="f">(</span><span class="b">sf</span><span class="f">)</span><span class="f">)</span><span class="f">-&gt;</span><span class="b">ob_item</span> \
<a name="1164" /><span class="True">    1164:</span>                       <span class="f">:</span> <span class="f">(</span><span class="f">(</span><span class="b">PyTupleObject</span> <span class="f">*</span><span class="f">)</span><span class="f">(</span><span class="b">sf</span><span class="f">)</span><span class="f">)</span><span class="f">-&gt;</span><span class="b">ob_item</span><span class="f">)</span>
<a name="1165" /><span class="True">    1165:</span>     <span class="k">/* Return a pointer to the underlying item array for</span>
<a name="1166" /><span class="True">    1166:</span> <span class="k">       an object retured by PySequence_Fast */</span>
<a name="1167" /><span class="True">    1167:</span> 
<a name="1168" /><span class="True">    1168:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">Py_ssize_t</span><span class="f">)</span> <span class="b">PySequence_Count</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">value</span><span class="f">)</span><span class="f">;</span>
<a name="1169" /><span class="True">    1169:</span> 
<a name="1170" /><span class="True">    1170:</span>        <span class="k">/*</span>
<a name="1171" /><span class="True">    1171:</span> <span class="k">     Return the number of occurrences on value on o, that is,</span>
<a name="1172" /><span class="True">    1172:</span> <span class="k">     return the number of keys for which o[key]==value.  On</span>
<a name="1173" /><span class="True">    1173:</span> <span class="k">     failure, return -1.  This is equivalent to the Python</span>
<a name="1174" /><span class="True">    1174:</span> <span class="k">     expression: o.count(value).</span>
<a name="1175" /><span class="True">    1175:</span> <span class="k">       */</span>
<a name="1176" /><span class="True">    1176:</span> 
<a name="1177" /><span class="True">    1177:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">PySequence_Contains</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">seq</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">ob</span><span class="f">)</span><span class="f">;</span>
<a name="1178" /><span class="True">    1178:</span>        <span class="k">/*</span>
<a name="1179" /><span class="True">    1179:</span> <span class="k">     Return -1 if error; 1 if ob in seq; 0 if ob not in seq.</span>
<a name="1180" /><span class="True">    1180:</span> <span class="k">     Use __contains__ if possible, else _PySequence_IterSearch().</span>
<a name="1181" /><span class="True">    1181:</span> <span class="k">       */</span>
<a name="1182" /><span class="True">    1182:</span> 
<a name="1183" /><span class="True">    1183:</span> <span class="f">#</span><span class="n">ifndef</span> <span class="b">Py_LIMITED_API</span>
<a name="1184" /><span class="True">    1184:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UFlfSVRFUlNFQVJDSF9DT1VOVF8w"><span class="b">PY_ITERSEARCH_COUNT</span></a>    <span class="c">1</span>
<a name="1185" /><span class="True">    1185:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UFlfSVRFUlNFQVJDSF9JTkRFWF8w"><span class="b">PY_ITERSEARCH_INDEX</span></a>    <span class="c">2</span>
<a name="1186" /><span class="True">    1186:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UFlfSVRFUlNFQVJDSF9DT05UQUlOU18w"><span class="b">PY_ITERSEARCH_CONTAINS</span></a> <span class="c">3</span>
<a name="1187" /><span class="True">    1187:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">Py_ssize_t</span><span class="f">)</span> <span class="b">_PySequence_IterSearch</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">seq</span><span class="f">,</span>
<a name="1188" /><span class="True">    1188:</span>                                         <span class="b">PyObject</span> <span class="f">*</span><span class="b">obj</span><span class="f">,</span> <span class="m">int</span> <span class="b">operation</span><span class="f">)</span><span class="f">;</span>
<a name="1189" /><span class="True">    1189:</span> <span class="f">#</span><span class="n">endif</span>
<a name="1190" /><span class="True">    1190:</span>     <span class="k">/*</span>
<a name="1191" /><span class="True">    1191:</span> <span class="k">      Iterate over seq.  Result depends on the operation:</span>
<a name="1192" /><span class="True">    1192:</span> <span class="k">      PY_ITERSEARCH_COUNT:  return # of times obj appears in seq; -1 if</span>
<a name="1193" /><span class="True">    1193:</span> <span class="k">        error.</span>
<a name="1194" /><span class="True">    1194:</span> <span class="k">      PY_ITERSEARCH_INDEX:  return 0-based index of first occurrence of</span>
<a name="1195" /><span class="True">    1195:</span> <span class="k">        obj in seq; set ValueError and return -1 if none found;</span>
<a name="1196" /><span class="True">    1196:</span> <span class="k">        also return -1 on error.</span>
<a name="1197" /><span class="True">    1197:</span> <span class="k">      PY_ITERSEARCH_CONTAINS:  return 1 if obj in seq, else 0; -1 on</span>
<a name="1198" /><span class="True">    1198:</span> <span class="k">        error.</span>
<a name="1199" /><span class="True">    1199:</span> <span class="k">    */</span>
<a name="1200" /><span class="True">    1200:</span> 
<a name="1201" /><span class="True">    1201:</span> <span class="k">/* For DLL-level backwards compatibility */</span>
<a name="1202" /><span class="True">    1202:</span> <span class="f">#</span><span class="n">undef</span> <a href="macros_noref.html#_UHlTZXF1ZW5jZV9Jbl8w"><span class="b">PySequence_In</span></a>
<a name="1203" /><span class="True">    1203:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <a href="macros_noref.html#_UHlTZXF1ZW5jZV9Jbl8w"><span class="b">PySequence_In</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">value</span><span class="f">)</span><span class="f">;</span>
<a name="1204" /><span class="True">    1204:</span> 
<a name="1205" /><span class="True">    1205:</span> <span class="k">/* For source-level backwards compatibility */</span>
<a name="1206" /><span class="True">    1206:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlTZXF1ZW5jZV9Jbl8w"><span class="b">PySequence_In</span></a> <span class="b">PySequence_Contains</span>
<a name="1207" /><span class="True">    1207:</span> 
<a name="1208" /><span class="True">    1208:</span>        <span class="k">/*</span>
<a name="1209" /><span class="True">    1209:</span> <span class="k">     Determine if o contains value.  If an item in o is equal to</span>
<a name="1210" /><span class="True">    1210:</span> <span class="k">     X, return 1, otherwise return 0.  On error, return -1.  This</span>
<a name="1211" /><span class="True">    1211:</span> <span class="k">     is equivalent to the Python expression: value in o.</span>
<a name="1212" /><span class="True">    1212:</span> <span class="k">       */</span>
<a name="1213" /><span class="True">    1213:</span> 
<a name="1214" /><span class="True">    1214:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">Py_ssize_t</span><span class="f">)</span> <span class="b">PySequence_Index</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">value</span><span class="f">)</span><span class="f">;</span>
<a name="1215" /><span class="True">    1215:</span> 
<a name="1216" /><span class="True">    1216:</span>        <span class="k">/*</span>
<a name="1217" /><span class="True">    1217:</span> <span class="k">     Return the first index for which o[i]=value.  On error,</span>
<a name="1218" /><span class="True">    1218:</span> <span class="k">     return -1.    This is equivalent to the Python</span>
<a name="1219" /><span class="True">    1219:</span> <span class="k">     expression: o.index(value).</span>
<a name="1220" /><span class="True">    1220:</span> <span class="k">       */</span>
<a name="1221" /><span class="True">    1221:</span> 
<a name="1222" /><span class="True">    1222:</span> <span class="k">/* In-place versions of some of the above Sequence functions. */</span>
<a name="1223" /><span class="True">    1223:</span> 
<a name="1224" /><span class="True">    1224:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PySequence_InPlaceConcat</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o1</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">o2</span><span class="f">)</span><span class="f">;</span>
<a name="1225" /><span class="True">    1225:</span> 
<a name="1226" /><span class="True">    1226:</span>        <span class="k">/*</span>
<a name="1227" /><span class="True">    1227:</span> <span class="k">     Append o2 to o1, in-place when possible. Return the resulting</span>
<a name="1228" /><span class="True">    1228:</span> <span class="k">     object, which could be o1, or NULL on failure.  This is the</span>
<a name="1229" /><span class="True">    1229:</span> <span class="k">     equivalent of the Python expression: o1 += o2.</span>
<a name="1230" /><span class="True">    1230:</span> <span class="k"></span>
<a name="1231" /><span class="True">    1231:</span> <span class="k">       */</span>
<a name="1232" /><span class="True">    1232:</span> 
<a name="1233" /><span class="True">    1233:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PySequence_InPlaceRepeat</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">,</span> <span class="b">Py_ssize_t</span> <span class="b">count</span><span class="f">)</span><span class="f">;</span>
<a name="1234" /><span class="True">    1234:</span> 
<a name="1235" /><span class="True">    1235:</span>        <span class="k">/*</span>
<a name="1236" /><span class="True">    1236:</span> <span class="k">     Repeat o1 by count, in-place when possible. Return the resulting</span>
<a name="1237" /><span class="True">    1237:</span> <span class="k">     object, which could be o1, or NULL on failure.  This is the</span>
<a name="1238" /><span class="True">    1238:</span> <span class="k">     equivalent of the Python expression: o1 *= count.</span>
<a name="1239" /><span class="True">    1239:</span> <span class="k"></span>
<a name="1240" /><span class="True">    1240:</span> <span class="k">       */</span>
<a name="1241" /><span class="True">    1241:</span> 
<a name="1242" /><span class="True">    1242:</span> <span class="k">/*  Mapping protocol:*/</span>
<a name="1243" /><span class="True">    1243:</span> 
<a name="1244" /><span class="True">    1244:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">PyMapping_Check</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">)</span><span class="f">;</span>
<a name="1245" /><span class="True">    1245:</span> 
<a name="1246" /><span class="True">    1246:</span>        <span class="k">/*</span>
<a name="1247" /><span class="True">    1247:</span> <span class="k">     Return 1 if the object provides mapping protocol, and zero</span>
<a name="1248" /><span class="True">    1248:</span> <span class="k">     otherwise.</span>
<a name="1249" /><span class="True">    1249:</span> <span class="k"></span>
<a name="1250" /><span class="True">    1250:</span> <span class="k">     This function always succeeds.</span>
<a name="1251" /><span class="True">    1251:</span> <span class="k">       */</span>
<a name="1252" /><span class="True">    1252:</span> 
<a name="1253" /><span class="True">    1253:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">Py_ssize_t</span><span class="f">)</span> <span class="b">PyMapping_Size</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">)</span><span class="f">;</span>
<a name="1254" /><span class="True">    1254:</span> 
<a name="1255" /><span class="True">    1255:</span>        <span class="k">/*</span>
<a name="1256" /><span class="True">    1256:</span> <span class="k">     Returns the number of keys in object o on success, and -1 on</span>
<a name="1257" /><span class="True">    1257:</span> <span class="k">     failure.  For objects that do not provide sequence protocol,</span>
<a name="1258" /><span class="True">    1258:</span> <span class="k">     this is equivalent to the Python expression: len(o).</span>
<a name="1259" /><span class="True">    1259:</span> <span class="k">       */</span>
<a name="1260" /><span class="True">    1260:</span> 
<a name="1261" /><span class="True">    1261:</span>        <span class="k">/* For DLL compatibility */</span>
<a name="1262" /><span class="True">    1262:</span> <span class="f">#</span><span class="n">undef</span> <a href="macros_noref.html#_UHlNYXBwaW5nX0xlbmd0aF8w"><span class="b">PyMapping_Length</span></a>
<a name="1263" /><span class="True">    1263:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">Py_ssize_t</span><span class="f">)</span> <a href="macros_noref.html#_UHlNYXBwaW5nX0xlbmd0aF8w"><span class="b">PyMapping_Length</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">)</span><span class="f">;</span>
<a name="1264" /><span class="True">    1264:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlNYXBwaW5nX0xlbmd0aF8w"><span class="b">PyMapping_Length</span></a> <span class="b">PyMapping_Size</span>
<a name="1265" /><span class="True">    1265:</span> 
<a name="1266" /><span class="True">    1266:</span> 
<a name="1267" /><span class="True">    1267:</span>      <span class="k">/* implemented as a macro:</span>
<a name="1268" /><span class="True">    1268:</span> <span class="k"></span>
<a name="1269" /><span class="True">    1269:</span> <span class="k">     int PyMapping_DelItemString(PyObject *o, const char *key);</span>
<a name="1270" /><span class="True">    1270:</span> <span class="k"></span>
<a name="1271" /><span class="True">    1271:</span> <span class="k">     Remove the mapping for object, key, from the object *o.</span>
<a name="1272" /><span class="True">    1272:</span> <span class="k">     Returns -1 on failure.  This is equivalent to</span>
<a name="1273" /><span class="True">    1273:</span> <span class="k">     the Python statement: del o[key].</span>
<a name="1274" /><span class="True">    1274:</span> <span class="k">       */</span>
<a name="1275" /><span class="True">    1275:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlNYXBwaW5nX0RlbEl0ZW1TdHJpbmdfMA__"><span class="b">PyMapping_DelItemString</span></a><span class="f">(</span><span class="b">O</span><span class="f">,</span><span class="b">K</span><span class="f">)</span> <span class="b">PyObject_DelItemString</span><span class="f">(</span><span class="f">(</span><span class="b">O</span><span class="f">)</span><span class="f">,</span><span class="f">(</span><span class="b">K</span><span class="f">)</span><span class="f">)</span>
<a name="1276" /><span class="True">    1276:</span> 
<a name="1277" /><span class="True">    1277:</span>      <span class="k">/* implemented as a macro:</span>
<a name="1278" /><span class="True">    1278:</span> <span class="k"></span>
<a name="1279" /><span class="True">    1279:</span> <span class="k">     int PyMapping_DelItem(PyObject *o, PyObject *key);</span>
<a name="1280" /><span class="True">    1280:</span> <span class="k"></span>
<a name="1281" /><span class="True">    1281:</span> <span class="k">     Remove the mapping for object, key, from the object *o.</span>
<a name="1282" /><span class="True">    1282:</span> <span class="k">     Returns -1 on failure.  This is equivalent to</span>
<a name="1283" /><span class="True">    1283:</span> <span class="k">     the Python statement: del o[key].</span>
<a name="1284" /><span class="True">    1284:</span> <span class="k">       */</span>
<a name="1285" /><span class="True">    1285:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlNYXBwaW5nX0RlbEl0ZW1fMA__"><span class="b">PyMapping_DelItem</span></a><span class="f">(</span><span class="b">O</span><span class="f">,</span><span class="b">K</span><span class="f">)</span> <span class="b">PyObject_DelItem</span><span class="f">(</span><span class="f">(</span><span class="b">O</span><span class="f">)</span><span class="f">,</span><span class="f">(</span><span class="b">K</span><span class="f">)</span><span class="f">)</span>
<a name="1286" /><span class="True">    1286:</span> 
<a name="1287" /><span class="True">    1287:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">PyMapping_HasKeyString</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">,</span> <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">key</span><span class="f">)</span><span class="f">;</span>
<a name="1288" /><span class="True">    1288:</span> 
<a name="1289" /><span class="True">    1289:</span>        <span class="k">/*</span>
<a name="1290" /><span class="True">    1290:</span> <span class="k">     On success, return 1 if the mapping object has the key, key,</span>
<a name="1291" /><span class="True">    1291:</span> <span class="k">     and 0 otherwise.  This is equivalent to the Python expression:</span>
<a name="1292" /><span class="True">    1292:</span> <span class="k">     key in o.</span>
<a name="1293" /><span class="True">    1293:</span> <span class="k"></span>
<a name="1294" /><span class="True">    1294:</span> <span class="k">     This function always succeeds.</span>
<a name="1295" /><span class="True">    1295:</span> <span class="k">       */</span>
<a name="1296" /><span class="True">    1296:</span> 
<a name="1297" /><span class="True">    1297:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">PyMapping_HasKey</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">key</span><span class="f">)</span><span class="f">;</span>
<a name="1298" /><span class="True">    1298:</span> 
<a name="1299" /><span class="True">    1299:</span>        <span class="k">/*</span>
<a name="1300" /><span class="True">    1300:</span> <span class="k">     Return 1 if the mapping object has the key, key,</span>
<a name="1301" /><span class="True">    1301:</span> <span class="k">     and 0 otherwise.  This is equivalent to the Python expression:</span>
<a name="1302" /><span class="True">    1302:</span> <span class="k">     key in o.</span>
<a name="1303" /><span class="True">    1303:</span> <span class="k"></span>
<a name="1304" /><span class="True">    1304:</span> <span class="k">     This function always succeeds.</span>
<a name="1305" /><span class="True">    1305:</span> <span class="k"></span>
<a name="1306" /><span class="True">    1306:</span> <span class="k">       */</span>
<a name="1307" /><span class="True">    1307:</span> 
<a name="1308" /><span class="True">    1308:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyMapping_Keys</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">)</span><span class="f">;</span>
<a name="1309" /><span class="True">    1309:</span> 
<a name="1310" /><span class="True">    1310:</span>        <span class="k">/*</span>
<a name="1311" /><span class="True">    1311:</span> <span class="k">     On success, return a list or tuple of the keys in object o.</span>
<a name="1312" /><span class="True">    1312:</span> <span class="k">     On failure, return NULL.</span>
<a name="1313" /><span class="True">    1313:</span> <span class="k">       */</span>
<a name="1314" /><span class="True">    1314:</span> 
<a name="1315" /><span class="True">    1315:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyMapping_Values</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">)</span><span class="f">;</span>
<a name="1316" /><span class="True">    1316:</span> 
<a name="1317" /><span class="True">    1317:</span>        <span class="k">/*</span>
<a name="1318" /><span class="True">    1318:</span> <span class="k">     On success, return a list or tuple of the values in object o.</span>
<a name="1319" /><span class="True">    1319:</span> <span class="k">     On failure, return NULL.</span>
<a name="1320" /><span class="True">    1320:</span> <span class="k">       */</span>
<a name="1321" /><span class="True">    1321:</span> 
<a name="1322" /><span class="True">    1322:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyMapping_Items</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">)</span><span class="f">;</span>
<a name="1323" /><span class="True">    1323:</span> 
<a name="1324" /><span class="True">    1324:</span>        <span class="k">/*</span>
<a name="1325" /><span class="True">    1325:</span> <span class="k">     On success, return a list or tuple of the items in object o,</span>
<a name="1326" /><span class="True">    1326:</span> <span class="k">     where each item is a tuple containing a key-value pair.</span>
<a name="1327" /><span class="True">    1327:</span> <span class="k">     On failure, return NULL.</span>
<a name="1328" /><span class="True">    1328:</span> <span class="k"></span>
<a name="1329" /><span class="True">    1329:</span> <span class="k">       */</span>
<a name="1330" /><span class="True">    1330:</span> 
<a name="1331" /><span class="True">    1331:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyMapping_GetItemString</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">,</span>
<a name="1332" /><span class="True">    1332:</span>                                                     <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">key</span><span class="f">)</span><span class="f">;</span>
<a name="1333" /><span class="True">    1333:</span> 
<a name="1334" /><span class="True">    1334:</span>        <span class="k">/*</span>
<a name="1335" /><span class="True">    1335:</span> <span class="k">     Return element of o corresponding to the object, key, or NULL</span>
<a name="1336" /><span class="True">    1336:</span> <span class="k">     on failure. This is the equivalent of the Python expression:</span>
<a name="1337" /><span class="True">    1337:</span> <span class="k">     o[key].</span>
<a name="1338" /><span class="True">    1338:</span> <span class="k">       */</span>
<a name="1339" /><span class="True">    1339:</span> 
<a name="1340" /><span class="True">    1340:</span>      <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">PyMapping_SetItemString</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">o</span><span class="f">,</span> <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">key</span><span class="f">,</span>
<a name="1341" /><span class="True">    1341:</span>                                             <span class="b">PyObject</span> <span class="f">*</span><span class="b">value</span><span class="f">)</span><span class="f">;</span>
<a name="1342" /><span class="True">    1342:</span> 
<a name="1343" /><span class="True">    1343:</span>        <span class="k">/*</span>
<a name="1344" /><span class="True">    1344:</span> <span class="k">     Map the object, key, to the value, v.  Returns</span>
<a name="1345" /><span class="True">    1345:</span> <span class="k">     -1 on failure.  This is the equivalent of the Python</span>
<a name="1346" /><span class="True">    1346:</span> <span class="k">     statement: o[key]=v.</span>
<a name="1347" /><span class="True">    1347:</span> <span class="k">      */</span>
<a name="1348" /><span class="True">    1348:</span> 
<a name="1349" /><span class="True">    1349:</span> 
<a name="1350" /><span class="True">    1350:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">PyObject_IsInstance</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">object</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">typeorclass</span><span class="f">)</span><span class="f">;</span>
<a name="1351" /><span class="True">    1351:</span>       <span class="k">/* isinstance(object, typeorclass) */</span>
<a name="1352" /><span class="True">    1352:</span> 
<a name="1353" /><span class="True">    1353:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">PyObject_IsSubclass</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">object</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">typeorclass</span><span class="f">)</span><span class="f">;</span>
<a name="1354" /><span class="True">    1354:</span>       <span class="k">/* issubclass(object, typeorclass) */</span>
<a name="1355" /><span class="True">    1355:</span> 
<a name="1356" /><span class="True">    1356:</span> 
<a name="1357" /><span class="True">    1357:</span> <span class="f">#</span><span class="n">ifndef</span> <span class="b">Py_LIMITED_API</span>
<a name="1358" /><span class="True">    1358:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">_PyObject_RealIsInstance</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">inst</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">cls</span><span class="f">)</span><span class="f">;</span>
<a name="1359" /><span class="True">    1359:</span> 
<a name="1360" /><span class="True">    1360:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">_PyObject_RealIsSubclass</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">derived</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">cls</span><span class="f">)</span><span class="f">;</span>
<a name="1361" /><span class="True">    1361:</span> 
<a name="1362" /><span class="True">    1362:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">char</span> <span class="f">*</span><span class="m">const</span> <span class="f">*</span><span class="f">)</span> <span class="b">_PySequence_BytesToCharpArray</span><span class="f">(</span><span class="b">PyObject</span><span class="f">*</span> <span class="b">self</span><span class="f">)</span><span class="f">;</span>
<a name="1363" /><span class="True">    1363:</span> 
<a name="1364" /><span class="True">    1364:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">void</span><span class="f">)</span> <span class="b">_Py_FreeCharPArray</span><span class="f">(</span><span class="m">char</span> <span class="f">*</span><span class="m">const</span> <span class="b">array</span><span class="f">[</span><span class="f">]</span><span class="f">)</span><span class="f">;</span>
<a name="1365" /><span class="True">    1365:</span> 
<a name="1366" /><span class="True">    1366:</span> <span class="k">/* For internal use by buffer API functions */</span>
<a name="1367" /><span class="True">    1367:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">void</span><span class="f">)</span> <span class="b">_Py_add_one_to_index_F</span><span class="f">(</span><span class="m">int</span> <span class="b">nd</span><span class="f">,</span> <span class="b">Py_ssize_t</span> <span class="f">*</span><span class="b">index</span><span class="f">,</span>
<a name="1368" /><span class="True">    1368:</span>                                         <span class="m">const</span> <span class="b">Py_ssize_t</span> <span class="f">*</span><span class="b">shape</span><span class="f">)</span><span class="f">;</span>
<a name="1369" /><span class="True">    1369:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">void</span><span class="f">)</span> <span class="b">_Py_add_one_to_index_C</span><span class="f">(</span><span class="m">int</span> <span class="b">nd</span><span class="f">,</span> <span class="b">Py_ssize_t</span> <span class="f">*</span><span class="b">index</span><span class="f">,</span>
<a name="1370" /><span class="True">    1370:</span>                                         <span class="m">const</span> <span class="b">Py_ssize_t</span> <span class="f">*</span><span class="b">shape</span><span class="f">)</span><span class="f">;</span>
<a name="1371" /><span class="True">    1371:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* !Py_LIMITED_API */</span>
<a name="1372" /><span class="True">    1372:</span> 
<a name="1373" /><span class="True">    1373:</span> 
<a name="1374" /><span class="False">    1374:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">__cplusplus</span>
<a name="1375" /><span class="False">    1375:</span> <span class="f">}</span>
<a name="1376" /><span class="True">    1376:</span> <span class="f">#</span><span class="n">endif</span>
<a name="1377" /><span class="True">    1377:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* Py_ABSTRACTOBJECT_H */</span>
<a name="1378" /><span class="True">    1378:</span> </pre>
  </body>
</html>
